home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / gtlayout / source / lt_new.c < prev    next >
C/C++ Source or Header  |  1999-04-19  |  101KB  |  3,861 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1998 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. /*****************************************************************************/
  15.  
  16. #include <clib/alib_protos.h>    /* For NewList */
  17.  
  18. #include <stdarg.h>
  19.  
  20. /*****************************************************************************/
  21.  
  22. #include "Assert.h"
  23.  
  24. /*****************************************************************************/
  25.  
  26.  
  27. VOID
  28. LTP_ReplaceLabelShortcut(LayoutHandle *Handle,ObjectNode * Node)
  29. {
  30.     ULONG    Len;
  31.     STRPTR    Label,*Index = Node->Special.Button.Lines;
  32.     BOOL    GotIt = FALSE;
  33.  
  34.     while(!GotIt)
  35.     {
  36.         if(Index)
  37.         {
  38.             if(!(Label = *Index++))
  39.                 break;
  40.         }
  41.         else
  42.         {
  43.             Label = Node->Label;
  44.             GotIt = TRUE;
  45.         }
  46.  
  47.         Len = 0;
  48.  
  49.         while(Label[Len])
  50.         {
  51.             if(Label[Len] == '_' && Label[Len + 1])
  52.             {
  53.                 STRPTR NewLabel = LTP_Alloc(Handle,strlen(Label));
  54.  
  55.                 if(NewLabel)
  56.                 {
  57.                     if(Len)
  58.                         CopyMem(Label,NewLabel,Len);
  59.  
  60.                     strcpy(&NewLabel[Len],&Label[Len + 1]);
  61.  
  62.                     Node->Special.Button.KeyStroke = &NewLabel[Len];
  63.  
  64.                     Node->Key = ToLower(NewLabel[Len]);
  65.  
  66.                     if(Index)
  67.                         Index[-1] = NewLabel;
  68.                     else
  69.                         Node->Label = NewLabel;
  70.                 }
  71.  
  72.                 GotIt = TRUE;
  73.  
  74.                 break;
  75.             }
  76.  
  77.             Len++;
  78.         }
  79.     }
  80. }
  81.  
  82.  
  83. /*****************************************************************************/
  84.  
  85.  
  86. VOID
  87. LT_AddL(LayoutHandle *handle,LONG type,ULONG labelID,LONG id,...)    /* link library only */
  88. {
  89.     if(handle)
  90.     {
  91.         struct TagItem *tagList;
  92.         va_list varArg;
  93.  
  94.         va_start(varArg,id);
  95.  
  96.         tagList = (struct TagItem *)varArg;
  97.  
  98.         if(handle->LocaleHook)
  99.         {
  100.             STRPTR label;
  101.  
  102.             label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)labelID);
  103.  
  104.             LT_AddA(handle,type,label,id,tagList);
  105.         }
  106.         else
  107.             handle->Failed = TRUE;
  108.  
  109.         va_end(varArgs);
  110.     }
  111. }
  112.  
  113.  
  114. /*****************************************************************************/
  115.  
  116.  
  117. VOID
  118. LT_New(LayoutHandle *handle,...)    /* link library only */
  119. {
  120.     va_list VarArgs;
  121.  
  122.     va_start(VarArgs,handle);
  123.     LT_NewA(handle,(struct TagItem *)VarArgs);
  124.     va_end(VarArgs);
  125. }
  126.  
  127.  
  128. /*****************************************************************************/
  129.  
  130.  
  131. VOID
  132. LT_Add(
  133.     LayoutHandle *    Handle,
  134.     LONG            Type,
  135.     STRPTR            Label,
  136.     LONG            ID,
  137.                     ...)    /* link library only */
  138. {
  139.     va_list VarArgs;
  140.  
  141.     va_start(VarArgs,ID);
  142.     LT_AddA(Handle,Type,Label,ID,(struct TagItem *)VarArgs);
  143.     va_end(VarArgs);
  144. }
  145.  
  146.  
  147. /*****************************************************************************/
  148.  
  149.  
  150. VOID LIBENT
  151. LT_AddA(
  152.     REG(a0) LayoutHandle *        Handle,
  153.     REG(d0) LONG                Type,
  154.     REG(d1) STRPTR                Label,
  155.     REG(d2) LONG                ID,
  156.     REG(a1) struct TagItem *    TagList)
  157. {
  158.     struct TagItem *TagItem;
  159.  
  160.     if(!Handle || Handle->Failed)
  161.         return;
  162.  
  163.     if(Type < GENERIC_KIND)
  164.     {
  165.         Handle->Failed = TRUE;
  166.         return;
  167.     }
  168.  
  169.     if(Type == VERTICAL_KIND || Type == HORIZONTAL_KIND || Handle->TopGroup)
  170.     {
  171.         ObjectNode *Node;
  172.         ULONG IDCMP;
  173.  
  174.         IDCMP = NULL;
  175.  
  176.         switch(Type)
  177.         {
  178.             case BUTTON_KIND:
  179.  
  180.                 IDCMP = BUTTONIDCMP;
  181.                 break;
  182.  
  183.             case CHECKBOX_KIND:
  184.  
  185.                 IDCMP = CHECKBOXIDCMP | IDCMP_MOUSEBUTTONS;
  186.                 break;
  187.  
  188.             case LISTVIEW_KIND:
  189.  
  190.                 IDCMP = LISTVIEWIDCMP;
  191.                 break;
  192.  
  193.             case MX_KIND:
  194.  
  195.                 IDCMP = MXIDCMP | IDCMP_MOUSEBUTTONS;
  196.                 break;
  197.  
  198.             case CYCLE_KIND:
  199.  
  200.                 IDCMP = CYCLEIDCMP;
  201.                 break;
  202.  
  203.             case PALETTE_KIND:
  204.  
  205.                 IDCMP = PALETTEIDCMP;
  206.                 break;
  207.  
  208.             case SLIDER_KIND:
  209.  
  210.                 IDCMP = SLIDERIDCMP;
  211.                 break;
  212.  
  213.             case SCROLLER_KIND:
  214.  
  215.                 IDCMP = SCROLLERIDCMP | ARROWIDCMP;
  216.                 break;
  217.  
  218.             case INTEGER_KIND:
  219.  
  220.                 IDCMP = STRINGIDCMP | IDCMP_GADGETDOWN | IDCMP_INTUITICKS;
  221.                 break;
  222.  
  223.             case FRAME_KIND:
  224.  
  225.                 IDCMP = IDCMP_MOUSEBUTTONS;
  226.                 break;
  227.  
  228.             case FRACTION_KIND:
  229.             case STRING_KIND:
  230.             case PASSWORD_KIND:
  231.  
  232.                 IDCMP = STRINGIDCMP | IDCMP_GADGETDOWN;
  233.                 break;
  234.  
  235.             #ifdef DO_LEVEL_KIND
  236.             {
  237.                 case LEVEL_KIND:
  238.  
  239.                     IDCMP = IDCMP_GADGETDOWN | IDCMP_MOUSEMOVE | IDCMP_GADGETUP;
  240.                     break;
  241.             }
  242.             #endif    /* DO_LEVEL_KIND */
  243.  
  244.             case END_KIND:
  245.  
  246.                 /* new in 45.1: fail if there is no group to be closed */
  247.                 if(Handle->CurrentGroup == NULL)
  248.                 {
  249.                     Handle->Failed = TRUE;
  250.                 }
  251.                 else
  252.                 {
  253.                     Handle->CurrentGroup = Handle->CurrentGroup->Special.Group.ParentGroup;
  254.                 }
  255.  
  256.                 return;
  257.  
  258.             #ifdef DO_POPUP_KIND
  259.             {
  260.                 case POPUP_KIND:
  261.  
  262.                     IDCMP = IDCMP_GADGETUP;
  263.                     break;
  264.             }
  265.             #endif
  266.  
  267.             #ifdef DO_TAB_KIND
  268.             {
  269.                 case TAB_KIND:
  270.  
  271.                     IDCMP = IDCMP_GADGETUP;
  272.                     break;
  273.             }
  274.             #endif
  275.         }
  276.  
  277.         Handle->IDCMP |= IDCMP;
  278.  
  279.         if(Node = LTP_CreateObjectNode(Handle,Type,ID,Label))
  280.         {
  281.             struct MinList *ParentList;
  282.             LONG FirstLabel;
  283.             LONG LastLabel;
  284.             LONG *LabelTable;
  285.             LONG *LineTable;
  286.             LONG FirstLine;
  287.             LONG LastLine;
  288.             STRPTR BoxLine;
  289.  
  290.             BoxLine = NULL;
  291.             LabelTable = LineTable = NULL;
  292.             FirstLabel = LastLabel = FirstLine = LastLine = -1;
  293.             Type = Node->Type;
  294.  
  295.             if(Type == GROUP_KIND)
  296.             {
  297.                 Node->Special.Group.ParentGroup = Handle->CurrentGroup;
  298.  
  299.                 if(!ID)
  300.                     Node->ID = Handle->GroupID--;
  301.  
  302.                 if(!Handle->TopGroup)
  303.                 {
  304.                     Handle->TopGroup = Node;
  305.  
  306.                     ParentList = NULL;
  307.                 }
  308.                 else
  309.                     ParentList = &Handle->CurrentGroup->Special.Group.ObjectList;
  310.  
  311.                 Handle->CurrentGroup = Node;
  312.  
  313.                 NewList((struct List *)&Node->Special.Group.ObjectList);
  314.             }
  315.             else
  316.                 ParentList = &Handle->CurrentGroup->Special.Group.ObjectList;
  317.  
  318.             if(Label && !Node->NoKey)
  319.             {
  320.                 LONG Len;
  321.  
  322.                 for(Len = 0 ; Label[Len] ; Len++)
  323.                 {
  324.                     if(Label[Len] == '_')
  325.                     {
  326.                         Node->Key = ToLower(Label[Len + 1]);
  327.  
  328.                         break;
  329.                     }
  330.                 }
  331.             }
  332.  
  333.             if(TagList)
  334.             {
  335.                 struct TagItem *TempList = TagList;
  336.                 ULONG ti_Data;
  337.  
  338.                 while(TagItem = NextTagItem(&TempList))
  339.                 {
  340.                     ti_Data = TagItem->ti_Data;
  341.  
  342.                     switch(TagItem->ti_Tag)
  343.                     {
  344.                         case LA_BYTE:
  345.  
  346.                             Node->Storage         = (APTR)ti_Data;
  347.                             Node->StorageType    = STORAGE_BYTE;
  348.  
  349.                             LTP_GetStorage(Node);
  350.  
  351.                             break;
  352.  
  353.                         case LA_UBYTE:
  354.  
  355.                             Node->Storage         = (APTR)ti_Data;
  356.                             Node->StorageType    = STORAGE_UBYTE;
  357.  
  358.                             LTP_GetStorage(Node);
  359.  
  360.                             break;
  361.  
  362.                         case LA_WORD:
  363.  
  364.                             Node->Storage         = (APTR)ti_Data;
  365.                             Node->StorageType    = STORAGE_WORD;
  366.  
  367.                             LTP_GetStorage(Node);
  368.  
  369.                             break;
  370.  
  371.                         case LA_UWORD:
  372.  
  373.                             Node->Storage         = (APTR)ti_Data;
  374.                             Node->StorageType    = STORAGE_UWORD;
  375.  
  376.                             LTP_GetStorage(Node);
  377.  
  378.                             break;
  379.  
  380.                         case LA_LONG:
  381.  
  382.                             Node->Storage         = (APTR)ti_Data;
  383.                             Node->StorageType    = STORAGE_LONG;
  384.  
  385.                             LTP_GetStorage(Node);
  386.  
  387.                             break;
  388.  
  389.                         case LA_ULONG:
  390.  
  391.                             Node->Storage         = (APTR)ti_Data;
  392.                             Node->StorageType    = STORAGE_ULONG;
  393.  
  394.                             LTP_GetStorage(Node);
  395.  
  396.                             break;
  397.  
  398.                         case LA_STRPTR:
  399.  
  400.                             Node->Storage         = (APTR)ti_Data;
  401.                             Node->StorageType    = STORAGE_STRPTR;
  402.  
  403.                             LTP_GetStorage(Node);
  404.  
  405.                             break;
  406.  
  407.                         case LAXB_FullSize:
  408.  
  409.                             if(Type == XBAR_KIND || Type == YBAR_KIND)
  410.                                 Node->Special.Bar.FullSize = ti_Data;
  411.  
  412.                             break;
  413.  
  414.                         case LA_LabelTable:
  415.  
  416.                             LabelTable = (LONG *)ti_Data;
  417.                             break;
  418.  
  419.                         case LA_FirstLabel:
  420.  
  421.                             FirstLabel = ti_Data;
  422.                             break;
  423.  
  424.                         case LA_LastLabel:
  425.  
  426.                             LastLabel = ti_Data;
  427.                             break;
  428.  
  429.                         case LA_LastGadget:
  430.  
  431.                             if(Type == INTEGER_KIND)
  432.                                 Node->Special.Integer.LastGadget = ti_Data;
  433.  
  434.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  435.                                 Node->Special.String.LastGadget = ti_Data;
  436.  
  437.                             break;
  438.  
  439.                         case LA_LabelChars:
  440.  
  441.                             Node->LabelChars = ti_Data;
  442.  
  443.                             break;
  444.  
  445.                         case LA_HistoryLines:
  446.  
  447.                             if(Type == INTEGER_KIND)
  448.                                 Node->Special.Integer.MaxHistoryLines = ti_Data;
  449.  
  450.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  451.                                 Node->Special.String.MaxHistoryLines = ti_Data;
  452.  
  453.                             break;
  454.  
  455.                         case LA_HistoryHook:
  456.  
  457.                             if(Type == INTEGER_KIND)
  458.                                 Node->Special.Integer.HistoryHook = (struct Hook *)ti_Data;
  459.  
  460.                             if(Type == STRING_KIND || Type == FRACTION_KIND)
  461.                                 Node->Special.String.HistoryHook = (struct Hook *)ti_Data;
  462.  
  463.                             break;
  464.  
  465.                         case LAIN_IncrementerHook:
  466.  
  467.                             if(Type == INTEGER_KIND)
  468.                                 Node->Special.Integer.IncrementerHook = (struct Hook *)ti_Data;
  469.  
  470.                             if(Type == FRACTION_KIND)
  471.                             {
  472.                                 if(Node->Special.String.IncrementerHook = (struct Hook *)ti_Data)
  473.                                     Handle->IDCMP |= IDCMP_INTUITICKS;
  474.                             }
  475.  
  476.                             break;
  477.  
  478.                         case LA_Min:
  479.  
  480.                             Node->Min = ti_Data;
  481.  
  482.                             break;
  483.  
  484.                         case LA_Max:
  485.  
  486.                             Node->Max = ti_Data;
  487.  
  488.                             break;
  489.  
  490.                         case LABX_Spacing:
  491.  
  492.                             if(Type == BOX_KIND)
  493.                                 Node->Special.Box.Spacing = ti_Data;
  494.  
  495.                             break;
  496.  
  497.                         case LABX_ReserveSpace:
  498.  
  499.                             if(Type == BOX_KIND)
  500.                                 Node->Special.Box.ReserveSpace = ti_Data;
  501.  
  502.                             break;
  503.  
  504.                         case LABX_TextPen:
  505.  
  506.                             if(Type == BOX_KIND)
  507.                                 Node->Special.Box.TextPen = ti_Data;
  508.  
  509.                             break;
  510.  
  511.                         case LABX_BackPen:
  512.  
  513.                             if(Type == BOX_KIND)
  514.                                 Node->Special.Box.BackPen = ti_Data;
  515.  
  516.                             break;
  517.  
  518.                         case LA_Chars:
  519.  
  520.                             Node->Chars = ti_Data;
  521.  
  522.                             break;
  523.  
  524.                         case LA_LabelPlace:
  525.  
  526.                             /* The group label placement cannot be
  527.                              * changed, and never could (new in V45.1).
  528.                              */
  529.                             if(Type != GROUP_KIND)
  530.                             {
  531.                                 Node->LabelPlace = ti_Data;
  532.         
  533.                                 if(Type == MX_KIND)
  534.                                 {
  535.                                     if(ti_Data == PLACE_RIGHT)
  536.                                         Node->LabelPlace = PLACE_RIGHT;
  537.                                     else
  538.                                         Node->LabelPlace = PLACE_LEFT;
  539.                                 }
  540.                             }
  541.  
  542.                             break;
  543.  
  544.                         case LA_ExtraSpace:
  545.  
  546.                             Node->ExtraSpace = (WORD)ti_Data;
  547.  
  548.                             if(Node->ExtraSpace == 1)
  549.                                 Node->ExtraSpace = 3;
  550.  
  551.                             break;
  552.  
  553.                         case LA_LayoutSpace:
  554.  
  555.                             Node->LayoutSpace = (UWORD)ti_Data;
  556.                             break;
  557.  
  558.                         case LA_PageSelector:
  559.  
  560.                             Node->PageSelector = ti_Data;
  561.                             break;
  562.  
  563.                         case LABT_ExtraFat:
  564.  
  565.                             if(Node->Type == BUTTON_KIND)
  566.                                 Node->Special.Button.ExtraFat = ti_Data;
  567.  
  568.                             break;
  569.  
  570.                         case LABT_Smaller:
  571.  
  572.                             if(Node->Type == BUTTON_KIND)
  573.                                 Node->Special.Button.Smaller = ti_Data;
  574.  
  575.                             break;
  576.  
  577.                         case LABT_DefaultCorrection:
  578.  
  579.                             if(Node->Type == BUTTON_KIND)
  580.                                 Node->Special.Button.DefaultCorrection = ti_Data;
  581.  
  582.                             break;
  583.  
  584.                         case LABT_Lines:
  585.  
  586.                             if(Node->Type == BUTTON_KIND)
  587.                                 Node->Special.Button.Lines = (STRPTR *)ti_Data;
  588.  
  589.                             break;
  590.  
  591.                         #ifdef DO_PICKSHORTCUTS
  592.                         {
  593.                             case LA_NoKey:
  594.  
  595.                                 Node->NoKey = ti_Data;
  596.                                 break;
  597.                         }
  598.                         #endif
  599.  
  600.                         case LA_DefaultSize:
  601.  
  602.                             Node->DefaultSize = ti_Data;
  603.                             break;
  604.  
  605.                         case LA_HighLabel:
  606.  
  607.                             Node->HighLabel = ti_Data;
  608.                             break;
  609.  
  610.                         case LAPA_SmallPalette:
  611.  
  612.                             if(Type == PALETTE_KIND)
  613.                                 Node->Special.Palette.SmallPalette = ti_Data;
  614.  
  615.                             break;
  616.  
  617.                         case LAPA_UsePicker:
  618.  
  619.                             if(Type == PALETTE_KIND)
  620.                                 Node->Special.Palette.UsePicker = ti_Data;
  621.  
  622.                             break;
  623.  
  624.                         case LA_Lines:
  625.  
  626.                             if(Type == BOX_KIND)
  627.                             {
  628.                                 LONG Count = ti_Data;
  629.  
  630.                                 if(Node->Lines != Count)
  631.                                 {
  632.                                     LTP_Free(Handle,Node->Special.Box.Lines,sizeof(STRPTR) * Node->Lines);
  633.  
  634.                                     Node->Special.Box.Lines = NULL;
  635.                                 }
  636.  
  637.                                 if(!Node->Special.Box.Lines)
  638.                                 {
  639.                                     if(Node->Special.Box.Lines = (STRPTR *)LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  640.                                     {
  641.                                         LONG i;
  642.  
  643.                                         for(i = 0 ; i < Count ; i++)
  644.                                             Node->Special.Box.Lines[i] = "";
  645.                                     }
  646.                                 }
  647.                             }
  648.  
  649.                             Node->Lines = ti_Data;
  650.  
  651.                             break;
  652.  
  653.                         case LA_Picker:
  654.  
  655.                             if(Type == TEXT_KIND)
  656.                                 Node->Special.Text.UsePicker = ti_Data;
  657.  
  658.                             if(Type == STRING_KIND)
  659.                                 Node->Special.String.UsePicker = ti_Data;
  660.  
  661.                             break;
  662.  
  663.                         case LACY_AutoPageID:
  664.  
  665.                             if(Type == CYCLE_KIND)
  666.                                 Node->Special.Cycle.AutoPageID = (LONG)ti_Data;
  667.  
  668.                             #ifdef DO_POPUP_KIND
  669.                             {
  670.                                 if(Type == POPUP_KIND)
  671.                                     Node->Special.Popup.AutoPageID = (LONG)ti_Data;
  672.                             }
  673.                             #endif
  674.  
  675.                             #ifdef DO_TAB_KIND
  676.                             {
  677.                                 if(Type == TAB_KIND)
  678.                                     Node->Special.Tab.AutoPageID = (LONG)ti_Data;
  679.                             }
  680.                             #endif
  681.  
  682.                             if(Type == MX_KIND)
  683.                                 Node->Special.Radio.AutoPageID = (LONG)ti_Data;
  684.  
  685.                             if(Type == LISTVIEW_KIND)
  686.                                 Node->Special.List.AutoPageID = (LONG)ti_Data;
  687.  
  688.                             break;
  689.  
  690.                         case LAGR_Spread:
  691.  
  692.                             if(Type == GROUP_KIND)
  693.                                 Node->Special.Group.Spread = ti_Data;
  694.  
  695.                             break;
  696.  
  697.                         case LAGR_AlignRight:
  698.  
  699.                             if(Type == GROUP_KIND)
  700.                                 Node->Special.Group.AlignRight = ti_Data;
  701.  
  702.                             break;
  703.  
  704.                         case LAGR_FrameGroup:
  705.  
  706.                             if(Type == GROUP_KIND)
  707.                                 Node->Special.Group.FrameType = ti_Data;
  708.  
  709.                             break;
  710.  
  711.                         case LAGR_NoIndent:
  712.  
  713.                             if(Type == GROUP_KIND)
  714.                                 Node->Special.Group.NoIndent = ti_Data;
  715.  
  716.                             break;
  717.  
  718.                         case LAGR_IndentX:
  719.  
  720.                             if(Type == GROUP_KIND)
  721.                                 Node->Special.Group.IndentX = ti_Data;
  722.  
  723.                             break;
  724.  
  725.                         case LAGR_IndentY:
  726.  
  727.                             if(Type == GROUP_KIND)
  728.                                 Node->Special.Group.IndentY = ti_Data;
  729.  
  730.                             break;
  731.  
  732.                         case LAGR_Frame:
  733.  
  734.                             if(Type == GROUP_KIND)
  735.                                 Node->Special.Group.Frame = ti_Data;
  736.  
  737.                             break;
  738.  
  739.                         case LAGR_SameSize:
  740.  
  741.                             if(Type == GROUP_KIND)
  742.                                 Node->Special.Group.SameSize = ti_Data;
  743.  
  744.                             break;
  745.  
  746.                         case LAGR_LastAttributes:
  747.  
  748.                             if(Type == GROUP_KIND)
  749.                                 Node->Special.Group.LastAttributes = ti_Data;
  750.  
  751.                             break;
  752.  
  753.                         case LAGR_ActivePage:
  754.  
  755.                             if(Type == GROUP_KIND)
  756.                             {
  757.                                 Node->Special.Group.ActivePage    = ti_Data;
  758.                                 Node->Special.Group.Paging    = TRUE;
  759.                             }
  760.  
  761.                             break;
  762.  
  763.                         case LABT_ReturnKey:
  764.  
  765.                             if(Type == BUTTON_KIND)
  766.                                 Node->Special.Button.ReturnKey = ti_Data;
  767.  
  768.                             break;
  769.  
  770.                         case LABT_EscKey:
  771.  
  772.                             if(Type == BUTTON_KIND)
  773.                                 Node->Special.Button.EscKey = ti_Data;
  774.  
  775.                             break;
  776.  
  777.                         case LALV_AdjustForString:
  778.  
  779.                             if(Type == LISTVIEW_KIND)
  780.                                 Node->Special.List.AdjustForString = ti_Data;
  781.  
  782.                             break;
  783.  
  784.                         case LALV_CursorKey:
  785.  
  786.                             if(Type == LISTVIEW_KIND)
  787.                                 Node->Special.List.CursorKey = ti_Data;
  788.  
  789.                             break;
  790.  
  791.                         case LALV_TextAttr:
  792.  
  793.                             if(Type == LISTVIEW_KIND)
  794.                                 Node->Special.List.TextAttr = (struct TextAttr *)ti_Data;
  795.  
  796.                             break;
  797.  
  798.                         case LALV_LockSize:
  799.  
  800.                             if(Type == LISTVIEW_KIND)
  801.                                 Node->Special.List.LockSize = ti_Data;
  802.  
  803.                             if(Type == TEXT_KIND)
  804.                                 Node->Special.Text.LockSize = ti_Data;
  805.  
  806.                             break;
  807.  
  808.                         case LALV_MaxGrowX:
  809.  
  810.                             if(Type == LISTVIEW_KIND)
  811.                             {
  812.                                 Handle->GrowView = Node;
  813.  
  814.                                 Node->Special.List.MaxGrowX = ti_Data;
  815.                             }
  816.  
  817.                             break;
  818.  
  819.                         case LALV_MaxGrowY:
  820.  
  821.                             if(Type == LISTVIEW_KIND)
  822.                             {
  823.                                 Handle->GrowView = Node;
  824.  
  825.                                 Node->Special.List.MaxGrowY = ti_Data;
  826.                             }
  827.  
  828.                             break;
  829.  
  830.                         case LALV_ResizeX:
  831.  
  832.                             if(Type == LISTVIEW_KIND)
  833.                             {
  834.                                 Handle->ResizeObject = Node;
  835.  
  836.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  837.  
  838.                                 Node->Special.List.ResizeX = ti_Data;
  839.                             }
  840.  
  841.                             if(Type == FRAME_KIND)
  842.                             {
  843.                                 Handle->ResizeObject = Node;
  844.  
  845.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  846.  
  847.                                 Node->Special.Frame.ResizeX = ti_Data;
  848.                             }
  849.  
  850.                             break;
  851.  
  852.                         case LALV_ResizeY:
  853.  
  854.                             if(Type == LISTVIEW_KIND)
  855.                             {
  856.                                 Handle->ResizeObject = Node;
  857.  
  858.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  859.  
  860.                                 Node->Special.List.ResizeY = ti_Data;
  861.                             }
  862.  
  863.                             if(Type == FRAME_KIND)
  864.                             {
  865.                                 Handle->ResizeObject = Node;
  866.  
  867.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  868.  
  869.                                 Node->Special.Frame.ResizeY = ti_Data;
  870.                             }
  871.  
  872.                             break;
  873.  
  874.                         case LALV_MinChars:
  875.  
  876.                             if(Type == LISTVIEW_KIND)
  877.                                 Node->Special.List.MinChars = ti_Data;
  878.  
  879.                             break;
  880.  
  881.                         case LALV_MinLines:
  882.  
  883.                             if(Type == LISTVIEW_KIND)
  884.                                 Node->Special.List.MinLines = ti_Data;
  885.  
  886.                             break;
  887.  
  888.                         case LALV_FlushLabelLeft:
  889.  
  890.                             if(Type == LISTVIEW_KIND)
  891.                                 Node->Special.List.FlushLabelLeft = ti_Data;
  892.  
  893.                             break;
  894.  
  895.                         case LALV_Labels:
  896.  
  897.                             if(Type == LISTVIEW_KIND)
  898.                             {
  899.                                 STRPTR *Labels = (STRPTR *)ti_Data;
  900.  
  901.                                 if(*Labels)
  902.                                 {
  903.                                     struct List *SomeList;
  904.  
  905.                                     if(SomeList = LTP_Alloc(Handle,sizeof(struct List)))
  906.                                     {
  907.                                         struct Node *SomeNode;
  908.  
  909.                                         NewList(SomeList);
  910.  
  911.                                         Node->Special.List.Labels = SomeList;
  912.  
  913.                                         while(*Labels)
  914.                                         {
  915.                                             if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node) + strlen(*Labels) + 1))
  916.                                             {
  917.                                                 SomeNode->ln_Name = (STRPTR)(SomeNode + 1);
  918.  
  919.                                                 strcpy(SomeNode->ln_Name,*Labels++);
  920.  
  921.                                                 AddTail(SomeList,SomeNode);
  922.                                             }
  923.                                         }
  924.                                     }
  925.                                 }
  926.                             }
  927.  
  928.                             break;
  929.  
  930.                         case LA_Link:
  931.  
  932.                             if(Type == LISTVIEW_KIND)
  933.                                 Node->Special.List.LinkID = ti_Data;
  934.  
  935.                             if(Type == STRING_KIND)
  936.                                 Node->Special.String.LinkID = ti_Data;
  937.  
  938.                             if(Type == BOOPSI_KIND)
  939.                                 Node->Special.BOOPSI.Link = (LONG)ti_Data;
  940.  
  941.                             break;
  942.  
  943.                         #ifdef DO_TAPEDECK_KIND
  944.                         {
  945.                             case LATD_ButtonType:
  946.  
  947.                                 if(Type == TAPEDECK_KIND)
  948.                                     Node->Special.TapeDeck.ButtonType = ti_Data;
  949.  
  950.                                 break;
  951.  
  952.                             case LATD_Toggle:
  953.  
  954.                                 if(Type == TAPEDECK_KIND)
  955.                                     Node->Special.TapeDeck.Toggle = ti_Data;
  956.  
  957.                                 break;
  958.  
  959.                             case LATD_Pressed:
  960.  
  961.                                 if(Type == TAPEDECK_KIND)
  962.                                     Node->Current = ti_Data;
  963.  
  964.                                 break;
  965.  
  966.                             case LATD_Tick:
  967.  
  968.                                 if(Type == TAPEDECK_KIND)
  969.                                     Node->Special.TapeDeck.Tick = ti_Data;
  970.  
  971.                                 break;
  972.  
  973.                             case LATD_Smaller:
  974.  
  975.                                 if(Type == TAPEDECK_KIND)
  976.                                     Node->Special.TapeDeck.Smaller = ti_Data;
  977.  
  978.                                 break;
  979.                         }
  980.                         #endif    /* DO_TAPEDECK_KIND */
  981.  
  982.                         #ifdef DO_GAUGE_KIND
  983.                         {
  984.                             case LAGA_Percent:
  985.  
  986.                                 if(Type == GAUGE_KIND)
  987.                                 {
  988.                                     LONG Percent = (LONG)ti_Data;
  989.  
  990.                                     if(Percent <= 0)
  991.                                         Node->Current = 0;
  992.                                     else
  993.                                     {
  994.                                         if(Percent > 100)
  995.                                             Node->Current = 100;
  996.                                         else
  997.                                             Node->Current = Percent;
  998.                                     }
  999.                                 }
  1000.  
  1001.                                 break;
  1002.  
  1003.                             case LAGA_NoTicks:
  1004.  
  1005.                                 if(Type == GAUGE_KIND)
  1006.                                     Node->Special.Gauge.NoTicks = ti_Data;
  1007.  
  1008.                                 break;
  1009.  
  1010.                             case LAGA_Discrete:
  1011.  
  1012.                                 if(Type == GAUGE_KIND)
  1013.                                     Node->Special.Gauge.Discrete = ti_Data;
  1014.  
  1015.                                 break;
  1016.  
  1017.                             case LAGA_InfoLength:
  1018.  
  1019.                                 if(Type == GAUGE_KIND)
  1020.                                 {
  1021.                                     LONG Length = (LONG)ti_Data;
  1022.  
  1023.                                     if(Length > Node->Special.Gauge.InfoLength)
  1024.                                     {
  1025.                                         STRPTR NewText;
  1026.  
  1027.                                         if(NewText = (STRPTR)LTP_Alloc(Handle,Length + 1))
  1028.                                         {
  1029.                                             if(Node->Special.Gauge.InfoText)
  1030.                                             {
  1031.                                                 strcpy(NewText,Node->Special.Gauge.InfoText);
  1032.  
  1033.                                                 LTP_Free(Handle,Node->Special.Gauge.InfoText,Node->Special.Gauge.InfoLength + 1);
  1034.                                             }
  1035.  
  1036.                                             NewText[0] = 0;
  1037.  
  1038.                                             Node->Special.Gauge.InfoText    = NewText;
  1039.                                             Node->Special.Gauge.InfoLength    = Length;
  1040.                                         }
  1041.                                     }
  1042.                                 }
  1043.  
  1044.                                 break;
  1045.  
  1046.                             case LAGA_InfoText:
  1047.  
  1048.                                 if(Type == GAUGE_KIND)
  1049.                                 {
  1050.                                     STRPTR    SomeText    = (STRPTR)ti_Data;
  1051.                                     LONG    Len            = strlen(SomeText);
  1052.  
  1053.                                     if(!Node->Special.Gauge.InfoLength)
  1054.                                     {
  1055.                                         if(Node->Special.Gauge.InfoText = (STRPTR)LTP_Alloc(Handle,Len + 1))
  1056.                                             Node->Special.Gauge.InfoLength = Len;
  1057.                                     }
  1058.  
  1059.                                     if(Node->Special.Gauge.InfoLength)
  1060.                                     {
  1061.                                         if(Len > Node->Special.Gauge.InfoLength)
  1062.                                             Len = Node->Special.Gauge.InfoLength;
  1063.  
  1064.                                         CopyMem(SomeText,Node->Special.Gauge.InfoText,Len);
  1065.  
  1066.                                         Node->Special.Gauge.InfoText[Len] = 0;
  1067.                                     }
  1068.                                 }
  1069.  
  1070.                                 break;
  1071.                         }
  1072.                         #endif
  1073.  
  1074.                         case LALV_ExtraLabels:
  1075.  
  1076.                             if(Type == LISTVIEW_KIND)
  1077.                                 Node->Special.List.ExtraLabels = (STRPTR *)ti_Data;
  1078.  
  1079.                             break;
  1080.  
  1081.                         case LACY_TabKey:
  1082.  
  1083.                             if(Type == CYCLE_KIND)
  1084.                                 Node->Special.Cycle.TabKey = ti_Data;
  1085.  
  1086.                             #ifdef DO_POPUP_KIND
  1087.                             {
  1088.                                 if(Type == POPUP_KIND)
  1089.                                     Node->Special.Popup.TabKey = ti_Data;
  1090.                             }
  1091.                             #endif
  1092.  
  1093.                             #ifdef DO_TAB_KIND
  1094.                             {
  1095.                                 if(Type == TAB_KIND)
  1096.                                     Node->Special.Tab.TabKey = ti_Data;
  1097.                             }
  1098.                             #endif
  1099.  
  1100.                             if(Type == MX_KIND)
  1101.                                 Node->Special.Radio.TabKey = ti_Data;
  1102.  
  1103.                             break;
  1104.  
  1105.                         #ifdef DO_TAB_KIND
  1106.                         {
  1107.                             case LATB_FullWidth:
  1108.  
  1109.                                 if(Type == TAB_KIND)
  1110.                                     Node->Special.Tab.FullWidth = ti_Data;
  1111.  
  1112.                                 break;
  1113.                         }
  1114.                         #endif
  1115.  
  1116.                         #ifdef DO_BOOPSI_KIND
  1117.                         {
  1118.                             case LABO_FullWidth:
  1119.  
  1120.                                 if(Type == BOOPSI_KIND)
  1121.                                     Node->Special.BOOPSI.FullWidth = (WORD)ti_Data;
  1122.  
  1123.                                 break;
  1124.  
  1125.                             case LABO_ActivateHook:
  1126.  
  1127.                                 if(Type == BOOPSI_KIND)
  1128.                                     Node->Special.BOOPSI.ActivateHook = (struct Hook *)ti_Data;
  1129.  
  1130.                                 break;
  1131.  
  1132.                             case LABO_FullHeight:
  1133.  
  1134.                                 if(Type == BOOPSI_KIND)
  1135.                                     Node->Special.BOOPSI.FullHeight = (WORD)ti_Data;
  1136.  
  1137.                                 break;
  1138.  
  1139.                             case LABO_RelFontHeight:
  1140.  
  1141.                                 if(Type == BOOPSI_KIND)
  1142.                                     Node->Special.BOOPSI.RelFontHeight = (WORD)ti_Data;
  1143.  
  1144.                                 break;
  1145.  
  1146.                             case LABO_TagScreen:
  1147.  
  1148.                                 if(Type == BOOPSI_KIND)
  1149.                                     Node->Special.BOOPSI.TagScreen = ti_Data;
  1150.  
  1151.                                 break;
  1152.  
  1153.                             case LABO_TagCurrent:
  1154.  
  1155.                                 if(Type == BOOPSI_KIND)
  1156.                                     Node->Special.BOOPSI.TagCurrent = ti_Data;
  1157.  
  1158.                                 break;
  1159.  
  1160.                             case LABO_TagLink:
  1161.  
  1162.                                 if(Type == BOOPSI_KIND)
  1163.                                     Node->Special.BOOPSI.TagLink = ti_Data;
  1164.  
  1165.                                 break;
  1166.  
  1167.                             case LABO_ExactWidth:
  1168.  
  1169.                                 if(Type == BOOPSI_KIND)
  1170.                                     Node->Special.BOOPSI.ExactWidth = ti_Data;
  1171.  
  1172.                                 break;
  1173.  
  1174.                             case LABO_ExactHeight:
  1175.  
  1176.                                 if(Type == BOOPSI_KIND)
  1177.                                     Node->Special.BOOPSI.ExactHeight = ti_Data;
  1178.  
  1179.                                 break;
  1180.  
  1181.                             case LABO_TagTextAttr:
  1182.  
  1183.                                 if(Type == BOOPSI_KIND)
  1184.                                     Node->Special.BOOPSI.TagTextAttr = ti_Data;
  1185.  
  1186.                                 break;
  1187.  
  1188.                             case LABO_TagDrawInfo:
  1189.  
  1190.                                 if(Type == BOOPSI_KIND)
  1191.                                     Node->Special.BOOPSI.TagDrawInfo = ti_Data;
  1192.  
  1193.                                 break;
  1194.  
  1195.                             case LABO_ClassInstance:
  1196.  
  1197.                                 if(Type == BOOPSI_KIND)
  1198.                                     Node->Special.BOOPSI.ClassInstance = (Class *)ti_Data;
  1199.  
  1200.                                 break;
  1201.  
  1202.                             case LABO_ClassName:
  1203.  
  1204.                                 if(Type == BOOPSI_KIND)
  1205.                                     Node->Special.BOOPSI.ClassName = (STRPTR)ti_Data;
  1206.  
  1207.                                 break;
  1208.  
  1209.                             case LABO_ClassLibraryName:
  1210.  
  1211.                                 if(Type == BOOPSI_KIND)
  1212.                                     Node->Special.BOOPSI.ClassLibraryName = (STRPTR)ti_Data;
  1213.  
  1214.                                 break;
  1215.                         }
  1216.                         #endif    /* DO_BOOPSI_KIND */
  1217.  
  1218.                         case LAIM_Image:
  1219.  
  1220.                             if(Node->Type == IMAGE_KIND)
  1221.                                 Node->Special.Image.Image = (struct Image *)ti_Data;
  1222.  
  1223.                             break;
  1224.  
  1225.                         case LAIM_BitMap:
  1226.  
  1227.                             if(Node->Type == IMAGE_KIND)
  1228.                                 Node->Special.Image.BitMap = (struct BitMap *)ti_Data;
  1229.  
  1230.                             break;
  1231.  
  1232.                         case LAIM_BitMapMask:
  1233.  
  1234.                             if(Node->Type == IMAGE_KIND)
  1235.                                 Node->Special.Image.BitMapMask = (PLANEPTR)ti_Data;
  1236.  
  1237.                             break;
  1238.  
  1239.                         case LAIM_BitMapLeft:
  1240.  
  1241.                             if(Node->Type == IMAGE_KIND)
  1242.                                 Node->Special.Image.BitMapLeft = ti_Data;
  1243.  
  1244.                             break;
  1245.  
  1246.                         case LAIM_BitMapTop:
  1247.  
  1248.                             if(Node->Type == IMAGE_KIND)
  1249.                                 Node->Special.Image.BitMapTop = ti_Data;
  1250.  
  1251.                             break;
  1252.  
  1253.                         case LAIM_BitMapWidth:
  1254.  
  1255.                             if(Node->Type == IMAGE_KIND)
  1256.                                 Node->Special.Image.BitMapWidth = ti_Data;
  1257.  
  1258.                             break;
  1259.  
  1260.                         case LAIM_BitMapHeight:
  1261.  
  1262.                             if(Node->Type == IMAGE_KIND)
  1263.                                 Node->Special.Image.BitMapHeight = ti_Data;
  1264.  
  1265.                             break;
  1266.  
  1267.                         case LAFR_RefreshHook:
  1268.  
  1269.                             if(Type == FRAME_KIND)
  1270.                                 Node->Special.Frame.RefreshHook = (struct Hook *)ti_Data;
  1271.  
  1272.                             break;
  1273.  
  1274.                         case LAFR_InnerWidth:
  1275.  
  1276.                             if(Type == FRAME_KIND)
  1277.                                 Node->Special.Frame.InnerWidth = ti_Data;
  1278.  
  1279.                             break;
  1280.  
  1281.                         case LAFR_InnerHeight:
  1282.  
  1283.                             if(Type == FRAME_KIND)
  1284.                                 Node->Special.Frame.InnerHeight = ti_Data;
  1285.  
  1286.                             break;
  1287.  
  1288.                         case LA_DrawBox:
  1289.  
  1290.                             if(Type == FRAME_KIND)
  1291.                                 Node->Special.Frame.DrawBox = ti_Data;
  1292.  
  1293.                             if(Type == BOX_KIND)
  1294.                                 Node->Special.Box.DrawBox = ti_Data;
  1295.  
  1296.                             break;
  1297.  
  1298.                         case LAFR_GenerateEvents:
  1299.  
  1300.                             if(Type == FRAME_KIND)
  1301.                                 Node->Special.Frame.GenerateEvents = ti_Data;
  1302.  
  1303.                             break;
  1304.  
  1305.                         case LABX_AlignText:
  1306.  
  1307.                             if(Type == BOX_KIND)
  1308.                                 Node->Special.Box.AlignText = ti_Data;
  1309.  
  1310.                             break;
  1311.  
  1312.                         case LABX_Line:
  1313.  
  1314.                             if(Type == BOX_KIND)
  1315.                                 BoxLine = (STRPTR)ti_Data;
  1316.  
  1317.                             break;
  1318.  
  1319.                         case LABX_LineID:
  1320.  
  1321.                             if(Type == BOX_KIND)
  1322.                             {
  1323.                                 if(Handle->LocaleHook)
  1324.                                     BoxLine = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)ti_Data);
  1325.                                 else
  1326.                                     Handle->Failed = TRUE;
  1327.                             }
  1328.  
  1329.                             break;
  1330.  
  1331.                         case LABX_Labels:
  1332.  
  1333.                             if(Type == BOX_KIND)
  1334.                             {
  1335.                                 STRPTR    *Labels = (STRPTR *)ti_Data;
  1336.                                 LONG     Count    = 0;
  1337.  
  1338.                                 while(Labels[Count])
  1339.                                     Count++;
  1340.  
  1341.                                 if(Node->Lines != Count)
  1342.                                 {
  1343.                                     LTP_Free(Handle,Node->Special.Box.Lines,sizeof(STRPTR) * Node->Lines);
  1344.  
  1345.                                     Node->Special.Box.Lines = NULL;
  1346.                                 }
  1347.  
  1348.                                 if(Count)
  1349.                                 {
  1350.                                     if(!Node->Special.Box.Lines)
  1351.                                     {
  1352.                                         if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  1353.                                         {
  1354.                                             LONG i;
  1355.  
  1356.                                             for(i = 0 ; i < Count ; i++)
  1357.                                                 Node->Special.Box.Lines[i] = "";
  1358.                                         }
  1359.                                     }
  1360.                                 }
  1361.  
  1362.                                 Node->Lines = Count;
  1363.  
  1364.                                 Node->Special.Box.Labels = Labels;
  1365.                             }
  1366.  
  1367.                             break;
  1368.  
  1369.                         case LABX_Lines:
  1370.  
  1371.                             if(Type == BOX_KIND)
  1372.                             {
  1373.                                 STRPTR    *Lines = (STRPTR *)ti_Data;
  1374.                                 LONG     Count = 0;
  1375.  
  1376.                                 while(Lines[Count])
  1377.                                     Count++;
  1378.  
  1379.                                 if(Node->Lines && Count > Node->Lines)
  1380.                                     Count = Node->Lines;
  1381.  
  1382.                                 if(Count)
  1383.                                 {
  1384.                                     if(!Node->Special.Box.Lines)
  1385.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1386.  
  1387.                                     if(Node->Special.Box.Lines)
  1388.                                     {
  1389.                                         LONG i;
  1390.  
  1391.                                         for(i = 0 ; i < Count ; i++)
  1392.                                             Node->Special.Box.Lines[i] = Lines[i];
  1393.                                     }
  1394.                                 }
  1395.  
  1396.                                 Node->Lines = Count;
  1397.                             }
  1398.  
  1399.                             break;
  1400.  
  1401.                         case LABX_LineTable:
  1402.  
  1403.                             if(Type == BOX_KIND)
  1404.                                 LineTable = (LONG *)ti_Data;
  1405.  
  1406.                             break;
  1407.  
  1408.                         case LABX_FirstLine:
  1409.  
  1410.                             if(Type == BOX_KIND)
  1411.                                 FirstLine = ti_Data;
  1412.  
  1413.                             break;
  1414.  
  1415.                         case LABX_LastLine:
  1416.  
  1417.                             if(Type == BOX_KIND)
  1418.                                 LastLine = ti_Data;
  1419.  
  1420.                             break;
  1421.  
  1422.                         case GA_Disabled:
  1423.  
  1424.                             Node->Disabled = ti_Data;
  1425.                             break;
  1426.  
  1427.                         case GTCB_Checked:
  1428.  
  1429.                             if(Type == CHECKBOX_KIND)
  1430.                                 Node->Current = ti_Data;
  1431.  
  1432.                             break;
  1433.  
  1434.                         case GTLV_Labels:
  1435.  
  1436.                             if(Type == LISTVIEW_KIND)
  1437.                             {
  1438.                                 if(ti_Data)
  1439.                                     Node->Special.List.Labels = (struct List *)ti_Data;
  1440.                                 else
  1441.                                     Node->Special.List.Labels = (struct List *)<P_EmptyList;
  1442.                             }
  1443.  
  1444.                             break;
  1445.  
  1446.                         case GTLV_ReadOnly:
  1447.  
  1448.                             if(Type == LISTVIEW_KIND)
  1449.                                 Node->Special.List.ReadOnly = ti_Data;
  1450.  
  1451.                             break;
  1452.  
  1453.                         case GTLV_Selected:
  1454.                         case LALV_Selected:
  1455.  
  1456.                             if(Type == LISTVIEW_KIND)
  1457.                                 Node->Current = (LONG)ti_Data;
  1458.  
  1459.                             break;
  1460.  
  1461.                         case GTLV_CallBack:
  1462.  
  1463.                             if(Type == LISTVIEW_KIND)
  1464.                                 Node->Special.List.CallBack = (struct Hook *)ti_Data;
  1465.  
  1466.                             break;
  1467.  
  1468.                         case GTLV_MaxPen:
  1469.  
  1470.                             if(Type == LISTVIEW_KIND)
  1471.                                 Node->Special.List.MaxPen = ti_Data;
  1472.  
  1473.                             break;
  1474.  
  1475.                         case GTMX_Labels:
  1476.  
  1477.                             if(Type == MX_KIND)
  1478.                                 Node->Special.Radio.Choices = (STRPTR *)ti_Data;
  1479.  
  1480.                             break;
  1481.  
  1482.                         case GTMX_Active:
  1483.  
  1484.                             if(Type == MX_KIND)
  1485.                                 Node->Current = ti_Data;
  1486.  
  1487.                             break;
  1488.  
  1489.                         case GTMX_TitlePlace:
  1490.  
  1491.                             if(Type == MX_KIND && Label)
  1492.                             {
  1493.                                 if(ti_Data == PLACE_RIGHT)
  1494.                                     Node->Special.Radio.TitlePlace = PLACETEXT_RIGHT;
  1495.                                 else
  1496.                                     Node->Special.Radio.TitlePlace = PLACETEXT_LEFT;
  1497.                             }
  1498.  
  1499.                             break;
  1500.  
  1501.                         case GTTX_Text:
  1502.  
  1503.                             if(Type == TEXT_KIND)
  1504.                                 Node->Special.Text.Text = (STRPTR)ti_Data;
  1505.  
  1506.                             break;
  1507.  
  1508.                         case GTTX_FrontPen:
  1509.  
  1510.                             if(Type == TEXT_KIND)
  1511.                                 Node->Special.Text.FrontPen = (WORD)ti_Data;
  1512.  
  1513.                             if(Type == NUMBER_KIND)
  1514.                                 Node->Special.Number.FrontPen = (WORD)ti_Data;
  1515.  
  1516.                             break;
  1517.  
  1518.                         case GTTX_BackPen:
  1519.  
  1520.                             if(Type == TEXT_KIND)
  1521.                                 Node->Special.Text.BackPen = (WORD)ti_Data;
  1522.  
  1523.                             if(Type == NUMBER_KIND)
  1524.                                 Node->Special.Number.BackPen = (WORD)ti_Data;
  1525.  
  1526.                             break;
  1527.  
  1528.                         case GTTX_CopyText:
  1529.  
  1530.                             if(Type == TEXT_KIND)
  1531.                                 Node->Special.Text.CopyText = ti_Data;
  1532.  
  1533.                             break;
  1534.  
  1535.                         case GTTX_Border:
  1536.  
  1537.                             if(Type == TEXT_KIND)
  1538.                                 Node->Special.Text.Border = ti_Data;
  1539.  
  1540.                             break;
  1541.  
  1542.                         case GTNM_Number:
  1543.  
  1544.                             if(Type == NUMBER_KIND)
  1545.                                 Node->Special.Number.Number = ti_Data;
  1546.  
  1547.                             break;
  1548.  
  1549.                         case GTNM_MaxNumberLen:
  1550.  
  1551.                             if(Type == NUMBER_KIND)
  1552.                                 Node->Special.Number.MaxNumberLen = ti_Data;
  1553.  
  1554.                             break;
  1555.  
  1556.                         case GTNM_Format:
  1557.  
  1558.                             if(Type == NUMBER_KIND)
  1559.                                 Node->Special.Number.Format = (STRPTR)ti_Data;
  1560.  
  1561.                             break;
  1562.  
  1563.                         case GTNM_Border:
  1564.  
  1565.                             if(Type == NUMBER_KIND)
  1566.                                 Node->Special.Number.Border = ti_Data;
  1567.  
  1568.                             break;
  1569.  
  1570.                         case GTTX_Justification:
  1571.  
  1572.                             if(Type == NUMBER_KIND)
  1573.                                 Node->Special.Number.Justification = ti_Data;
  1574.  
  1575.                             if(Type == TEXT_KIND)
  1576.                                 Node->Special.Text.Justification = ti_Data;
  1577.  
  1578.                             break;
  1579.  
  1580.                         case LAPU_CentreActive:
  1581.  
  1582.                             if(Type == POPUP_KIND)
  1583.                                 Node->Special.Popup.CentreActive = ti_Data;
  1584.  
  1585.                             break;
  1586.  
  1587.                         case GTCY_Labels:
  1588.  
  1589.                             if(Type == CYCLE_KIND)
  1590.                                 Node->Special.Cycle.Choices = (STRPTR *)ti_Data;
  1591.  
  1592.                             #ifdef DO_POPUP_KIND
  1593.                             {
  1594.                                 if(Type == POPUP_KIND)
  1595.                                     Node->Special.Popup.Choices = (STRPTR *)ti_Data;
  1596.                             }
  1597.                             #endif
  1598.  
  1599.                             #ifdef DO_TAB_KIND
  1600.                             {
  1601.                                 if(Type == TAB_KIND)
  1602.                                     Node->Special.Tab.Choices = (STRPTR *)ti_Data;
  1603.                             }
  1604.                             #endif
  1605.  
  1606.                             break;
  1607.  
  1608.                         case GTCY_Active:
  1609.  
  1610.                             if(Type == CYCLE_KIND)
  1611.                                 Node->Current = ti_Data;
  1612.  
  1613.                             #ifdef DO_POPUP_KIND
  1614.                             {
  1615.                                 if(Type == POPUP_KIND)
  1616.                                     Node->Current = ti_Data;
  1617.                             }
  1618.                             #endif
  1619.  
  1620.                             #ifdef DO_TAB_KIND
  1621.                             {
  1622.                                 if(Type == TAB_KIND)
  1623.                                     Node->Current = ti_Data;
  1624.                             }
  1625.                             #endif
  1626.  
  1627.                             break;
  1628.  
  1629.                         case GTPA_Depth:
  1630.  
  1631.                             if(Type == PALETTE_KIND)
  1632.                             {
  1633.                                 Node->Special.Palette.Depth = ti_Data;
  1634.  
  1635.                                 if(Handle->MaxPen < (1L << Node->Special.Palette.Depth) - 1)
  1636.                                     Handle->MaxPen = (1L << Node->Special.Palette.Depth) - 1;
  1637.                             }
  1638.  
  1639.                             break;
  1640.  
  1641.                         case GTPA_Color:
  1642.  
  1643.                             if(Type == PALETTE_KIND)
  1644.                                 Node->Current = ti_Data;
  1645.  
  1646.                             break;
  1647.  
  1648.                         case GTPA_ColorOffset:
  1649.  
  1650.                             if(Type == PALETTE_KIND)
  1651.                                 Node->Min = ti_Data;
  1652.  
  1653.                             break;
  1654.  
  1655.                         case GTPA_NumColors:
  1656.  
  1657.                             if(Type == PALETTE_KIND)
  1658.                             {
  1659.                                 Node->Special.Palette.NumColours = ti_Data;
  1660.  
  1661.                                 if(Node->Special.Palette.ColourTable)
  1662.                                 {
  1663.                                     LONG i;
  1664.  
  1665.                                     for(i = 0 ; i < Node->Special.Palette.NumColours ; i++)
  1666.                                     {
  1667.                                         if(Node->Special.Palette.ColourTable[i] > Handle->MaxPen)
  1668.                                             Handle->MaxPen = Node->Special.Palette.ColourTable[i];
  1669.                                     }
  1670.                                 }
  1671.                             }
  1672.  
  1673.                             break;
  1674.  
  1675.                         case GTPA_ColorTable:
  1676.  
  1677.                             if(Type == PALETTE_KIND)
  1678.                             {
  1679.                                 Node->Special.Palette.ColourTable = (UBYTE *)ti_Data;
  1680.  
  1681.                                 if(Node->Special.Palette.NumColours)
  1682.                                 {
  1683.                                     LONG i;
  1684.  
  1685.                                     for(i = 0 ; i < Node->Special.Palette.NumColours ; i++)
  1686.                                     {
  1687.                                         if(Node->Special.Palette.ColourTable[i] > Handle->MaxPen)
  1688.                                             Handle->MaxPen = Node->Special.Palette.ColourTable[i];
  1689.                                     }
  1690.                                 }
  1691.                             }
  1692.  
  1693.                             break;
  1694.  
  1695.                         case GA_RelVerify:
  1696.  
  1697.                             if(Type == SCROLLER_KIND)
  1698.                                 Node->Special.Scroller.RelVerify = ti_Data;
  1699.  
  1700.                             break;
  1701.  
  1702.                         case GA_Immediate:
  1703.  
  1704.                             if(Type == SCROLLER_KIND)
  1705.                                 Node->Special.Scroller.Immediate = ti_Data;
  1706.  
  1707.                             break;
  1708.  
  1709.                         case GTSC_Top:
  1710.  
  1711.                             if(Type == SCROLLER_KIND)
  1712.                                 Node->Current = ti_Data;
  1713.  
  1714.                             break;
  1715.  
  1716.                         case GTSC_Total:
  1717.  
  1718.                             if(Type == SCROLLER_KIND)
  1719.                                 Node->Max = ti_Data;
  1720.  
  1721.                             break;
  1722.  
  1723.                         case GTSC_Visible:
  1724.  
  1725.                             if(Type == SCROLLER_KIND)
  1726.                                 Node->Special.Scroller.Visible = ti_Data;
  1727.  
  1728.                             break;
  1729.  
  1730.                         case GTSC_Arrows:
  1731.  
  1732.                             if(Type == SCROLLER_KIND)
  1733.                                 Node->Special.Scroller.Arrows = (ti_Data != 0);
  1734.  
  1735.                             break;
  1736.  
  1737.                         case LASC_Thin:
  1738.  
  1739.                             if(Type == SCROLLER_KIND)
  1740.                                 Node->Special.Scroller.Thin = ti_Data;
  1741.  
  1742.                             break;
  1743.  
  1744.                         case LASC_FullSize:
  1745.  
  1746.                             if(Type == SCROLLER_KIND)
  1747.                             {
  1748.                                 Node->Special.Scroller.FullSize = ti_Data;
  1749.                                 Node->Special.Scroller.Parent = Handle->CurrentGroup;
  1750.                             }
  1751.  
  1752.                             break;
  1753.  
  1754.                         case PGA_Freedom:
  1755.  
  1756.                             if(Type == SCROLLER_KIND)
  1757.                                 Node->Special.Scroller.Vertical = (ti_Data == LORIENT_VERT);
  1758.  
  1759.                             #ifdef DO_LEVEL_KIND
  1760.                             {
  1761.                                 if(Type == LEVEL_KIND)
  1762.                                     Node->Special.Level.Freedom = (ti_Data == FREEVERT) ? FREEVERT : FREEHORIZ;
  1763.                             }
  1764.                             #endif /* DO_LEVEL_KIND */
  1765.  
  1766.                             break;
  1767.  
  1768.                         #ifdef DO_LEVEL_KIND
  1769.                         {
  1770.                             case LAVL_Freedom:
  1771.  
  1772.                                 if(Type == LEVEL_KIND)
  1773.                                     Node->Special.Level.Freedom = (ti_Data == FREEVERT) ? FREEVERT : FREEHORIZ;
  1774.  
  1775.                                 break;
  1776.  
  1777.                             case LAVL_Ticks:
  1778.  
  1779.                                 if(Type == LEVEL_KIND)
  1780.                                     Node->Special.Level.Ticks = ti_Data;
  1781.  
  1782.                                 break;
  1783.  
  1784.                             case LAVL_NumTicks:
  1785.  
  1786.                                 if(Type == LEVEL_KIND)
  1787.                                     Node->Special.Level.NumTicks = ti_Data;
  1788.  
  1789.                                 break;
  1790.                         }
  1791.                         #endif    /* DO_LEVEL_KIND */
  1792.  
  1793.                         case GTSL_Min:
  1794.  
  1795.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1796.                                 Node->Min = ti_Data;
  1797.  
  1798.                             break;
  1799.  
  1800.                         case GTSL_Max:
  1801.  
  1802.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1803.                                 Node->Max = ti_Data;
  1804.  
  1805.                             break;
  1806.  
  1807.                         case GTSL_Level:
  1808.  
  1809.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1810.                                 Node->Current = ti_Data;
  1811.  
  1812.                             break;
  1813.  
  1814.                         case GTSL_LevelFormat:
  1815.  
  1816.                             #ifdef DO_LEVEL_KIND
  1817.                             {
  1818.                                 if(Type == LEVEL_KIND)
  1819.                                     Node->Special.Level.LevelFormat = (STRPTR)ti_Data;
  1820.                             }
  1821.                             #endif    /* DO_LEVEL_KIND */
  1822.  
  1823.                             if(Type == SLIDER_KIND)
  1824.                                 Node->Special.Slider.LevelFormat = (STRPTR)ti_Data;
  1825.  
  1826.                             break;
  1827.  
  1828.                         case GTSL_LevelPlace:
  1829.  
  1830.                             #ifdef DO_LEVEL_KIND
  1831.                             {
  1832.                                 if(Type == LEVEL_KIND)
  1833.                                 {
  1834.                                     if(ti_Data == PLACE_RIGHT)
  1835.                                         Node->Special.Level.LevelPlace = PLACETEXT_RIGHT;
  1836.                                     else
  1837.                                         Node->Special.Level.LevelPlace = PLACETEXT_LEFT;
  1838.                                 }
  1839.                             }
  1840.                             #endif    /* DO_LEVEL_KIND */
  1841.  
  1842.                             if(Type == SLIDER_KIND)
  1843.                             {
  1844.                                 if(ti_Data == PLACE_RIGHT)
  1845.                                     Node->Special.Slider.LevelPlace = PLACETEXT_RIGHT;
  1846.                                 else
  1847.                                     Node->Special.Slider.LevelPlace = PLACETEXT_LEFT;
  1848.                             }
  1849.  
  1850.                             break;
  1851.  
  1852.                         case GTSL_DispFunc:
  1853.  
  1854.                             #ifdef DO_LEVEL_KIND
  1855.                             {
  1856.                                 if(Type == LEVEL_KIND)
  1857.                                     Node->Special.Level.DispFunc = (DISPFUNC)ti_Data;
  1858.                             }
  1859.                             #endif    /* DO_LEVEL_KIND */
  1860.  
  1861.                             if(Type == SLIDER_KIND)
  1862.                                 Node->Special.Slider.DispFunc = (DISPFUNC)ti_Data;
  1863.  
  1864.                             break;
  1865.  
  1866.                         case LASL_FullCheck:
  1867.  
  1868.                             if(Type == SLIDER_KIND)
  1869.                                 Node->Special.Slider.FullLevelCheck = ti_Data;
  1870.  
  1871.                             #ifdef DO_LEVEL_KIND
  1872.                             {
  1873.                                 if(Type == LEVEL_KIND)
  1874.                                     Node->Special.Level.FullLevelCheck = ti_Data;
  1875.                             }
  1876.                             #endif    /* DO_LEVEL_KIND */
  1877.  
  1878.                             break;
  1879.  
  1880.                         case GTST_String:
  1881.  
  1882.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1883.                                 Node->Special.String.String = (STRPTR)ti_Data;
  1884.  
  1885.                             break;
  1886.  
  1887.                         case LAST_Activate:
  1888.  
  1889.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1890.                                 Node->Special.String.Activate = ti_Data;
  1891.  
  1892.                             if(Type == INTEGER_KIND)
  1893.                                 Node->Special.Integer.Activate = ti_Data;
  1894.  
  1895.                             break;
  1896.  
  1897.                         case GTST_MaxChars:
  1898.  
  1899.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1900.                                 Node->Special.String.MaxChars = ti_Data;
  1901.  
  1902.                             break;
  1903.  
  1904.                         case GTST_EditHook:
  1905.  
  1906.                             if(Type == STRING_KIND)
  1907.                                 Node->Special.String.EditHook = (struct Hook *)ti_Data;
  1908.                             else
  1909.                             {
  1910.                                 if(Type == INTEGER_KIND)
  1911.                                 {
  1912.                                     if(Node->Special.Integer.EditHook = (struct Hook *)ti_Data)
  1913.                                         Node->Special.Integer.CustomHook = TRUE;
  1914.                                 }
  1915.                             }
  1916.  
  1917.                             break;
  1918.  
  1919.                         case LAST_ValidateHook:
  1920.  
  1921.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1922.                                 Node->Special.String.ValidateHook = (struct Hook *)ti_Data;
  1923.                             else
  1924.                             {
  1925.                                 if(Type == INTEGER_KIND)
  1926.                                     Node->Special.Integer.ValidateHook = (struct Hook *)ti_Data;
  1927.                             }
  1928.  
  1929.                             break;
  1930.  
  1931.                         case STRINGA_Justification:
  1932.  
  1933.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1934.                                 Node->Special.String.Justification = ti_Data;
  1935.                             else
  1936.                             {
  1937.                                 if(Type == INTEGER_KIND)
  1938.                                     Node->Special.Integer.Justification = ti_Data;
  1939.                             }
  1940.  
  1941.                             break;
  1942.  
  1943.                         case LAIN_UseIncrementers:
  1944.  
  1945.                             if(Type == INTEGER_KIND)
  1946.                             {
  1947.                                 if(Node->Special.Integer.UseIncrementers = ti_Data)
  1948.                                     Handle->IDCMP |= IDCMP_INTUITICKS;
  1949.                             }
  1950.  
  1951.                             break;
  1952.  
  1953.                         case GTIN_Number:
  1954.  
  1955.                             if(Type == INTEGER_KIND)
  1956.                                 Node->Special.Integer.Number = ti_Data;
  1957.  
  1958.                             break;
  1959.  
  1960.                         case GTIN_MaxChars:
  1961.  
  1962.                             if(Type == INTEGER_KIND)
  1963.                                 Node->Special.Integer.MaxChars = ti_Data;
  1964.  
  1965.                             break;
  1966.                     }
  1967.                 }
  1968.             }
  1969.  
  1970.             if(Handle->Failed)
  1971.                 return;
  1972.  
  1973.             switch(Type)
  1974.             {
  1975.                 case STRING_KIND:
  1976.                 case INTEGER_KIND:
  1977.                 case FRACTION_KIND:
  1978.  
  1979.                     if(Node->Special.String.MaxHistoryLines)
  1980.                     {
  1981.                         if(!Node->Special.Integer.HistoryHook)
  1982.                         {
  1983.                             struct Hook *Hook;
  1984.  
  1985.                             if(Hook = (struct Hook *)LTP_Alloc(Handle,sizeof(struct Hook) + sizeof(struct MinList)))
  1986.                             {
  1987.                                 struct MinList *List;
  1988.  
  1989.                                 List = Hook->h_Data = (APTR)(Hook + 1);
  1990.  
  1991.                                 NewList((struct List *)List);
  1992.  
  1993.                                 Hook->h_Entry = (HOOKFUNC)LTP_DefaultHistoryHook;
  1994.  
  1995.                                 Node->Special.Integer.HistoryHook = Hook;
  1996.                             }
  1997.                         }
  1998.  
  1999.                         if(Node->Special.Integer.HistoryHook)
  2000.                         {
  2001.                             struct Node    *TextNode;
  2002.                             struct MinList *List;
  2003.  
  2004.                             List = (struct List *)Node->Special.Integer.HistoryHook->h_Data;
  2005.  
  2006.                             Node->Special.Integer.LayoutHandle = Handle;
  2007.                             Node->Special.Integer.NumHistoryLines = 0;
  2008.  
  2009.                             TextNode = (struct Node *)List->mlh_Head;
  2010.  
  2011.                             while(TextNode->ln_Succ)
  2012.                             {
  2013.                                 Node->Special.Integer.NumHistoryLines++;
  2014.  
  2015.                                 TextNode = TextNode->ln_Succ;
  2016.                             }
  2017.                         }
  2018.                     }
  2019.  
  2020.                     break;
  2021.  
  2022.                 #ifdef DO_TAB_KIND
  2023.                 {
  2024.                     case TAB_KIND:
  2025.  
  2026.                         Node->Special.Tab.Parent = Handle->CurrentGroup;
  2027.                         break;
  2028.                 }
  2029.                 #endif
  2030.  
  2031.                 #ifdef DO_BOOPSI_KIND
  2032.                 {
  2033.                     case BOOPSI_KIND:
  2034.  
  2035.                         Node->Special.BOOPSI.Parent = Handle->CurrentGroup;
  2036.  
  2037.                         if(Node->Special.BOOPSI.ClassTags = CloneTagItems(TagList))
  2038.                         {
  2039.                             STATIC const Tag Exclude[] =
  2040.                             {
  2041.                                 LA_Chars,
  2042.                                 LA_Lines,
  2043.                                 LABO_TagCurrent,
  2044.                                 LABO_TagTextAttr,
  2045.                                 LABO_TagDrawInfo,
  2046.                                 LABO_ClassInstance,
  2047.                                 LABO_ClassName,
  2048.                                 LABO_ClassLibraryName,
  2049.                                 LABO_ExactWidth,
  2050.                                 LABO_ExactHeight,
  2051.  
  2052.                                 TAG_DONE
  2053.                             };
  2054.  
  2055.                             FilterTagItems(Node->Special.BOOPSI.ClassTags,(Tag *)Exclude,TAGFILTER_NOT);
  2056.                         }
  2057.                         else
  2058.                             Handle->Failed = TRUE;
  2059.  
  2060.                         break;
  2061.                 }
  2062.                 #endif    /* DO_BOOPSI_KIND */
  2063.  
  2064.                 case TEXT_KIND:
  2065.  
  2066.                     if(Node->Special.Text.CopyText && Node->Special.Text.Text)
  2067.                     {
  2068.                         STRPTR text;
  2069.  
  2070.                         if(text = LTP_Alloc(Handle,strlen(Node->Special.Text.Text) + 1))
  2071.                         {
  2072.                             strcpy(text,Node->Special.Text.Text);
  2073.  
  2074.                             Node->Special.Text.Text = text;
  2075.                         }
  2076.                     }
  2077.  
  2078.                     break;
  2079.  
  2080.                 case BOX_KIND:
  2081.  
  2082.                     if(FirstLine != -1 && LastLine != -1)
  2083.                     {
  2084.                         if(FirstLine <= LastLine && Handle->LocaleHook)
  2085.                         {
  2086.                             LONG Count = LastLine - FirstLine + 1;
  2087.  
  2088.                             if(Node->Lines && Count > Node->Lines)
  2089.                                 Count = Node->Lines;
  2090.                             else
  2091.                                 Node->Lines = Count;
  2092.  
  2093.                             if(Count)
  2094.                             {
  2095.                                 if(!Node->Special.Box.Lines)
  2096.                                     Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  2097.  
  2098.                                 if(Node->Special.Box.Lines)
  2099.                                 {
  2100.                                     LONG i;
  2101.  
  2102.                                     for(i = 0 ; i < Count ; i++)
  2103.                                         Node->Special.Box.Lines[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLine + i));
  2104.                                 }
  2105.                             }
  2106.                         }
  2107.                         else
  2108.                             Handle->Failed = TRUE;
  2109.                     }
  2110.                     else
  2111.                     {
  2112.                         if(LineTable)
  2113.                         {
  2114.                             if(Handle->LocaleHook)
  2115.                             {
  2116.                                 LONG Count = 0;
  2117.  
  2118.                                 while(LineTable[Count] != -1)
  2119.                                     Count++;
  2120.  
  2121.                                 if(Node->Lines && Count > Node->Lines)
  2122.                                     Count = Node->Lines;
  2123.                                 else
  2124.                                     Node->Lines = Count;
  2125.  
  2126.                                 if(Count)
  2127.                                 {
  2128.                                     if(!Node->Special.Box.Lines)
  2129.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  2130.  
  2131.                                     if(Node->Special.Box.Lines)
  2132.                                     {
  2133.                                         LONG i;
  2134.  
  2135.                                         for(i = 0 ; i < Count ; i++)
  2136.                                             Node->Special.Box.Lines[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(LineTable[i]));
  2137.                                     }
  2138.                                 }
  2139.                             }
  2140.                             else
  2141.                                 Handle->Failed = TRUE;
  2142.                         }
  2143.                         else
  2144.                         {
  2145.                             if(BoxLine)
  2146.                             {
  2147.                                 LONG Count,i;
  2148.  
  2149.                                 for(i = 0, Count = 1 ; i < strlen(BoxLine) ; i++)
  2150.                                 {
  2151.                                     if(BoxLine[i] == '\n')
  2152.                                         Count++;
  2153.                                 }
  2154.  
  2155.                                 if(Node->Lines && Count > Node->Lines)
  2156.                                     Count = Node->Lines;
  2157.                                 else
  2158.                                     Node->Lines = Count;
  2159.  
  2160.                                 if(Count)
  2161.                                 {
  2162.                                     if(!Node->Special.Box.Lines)
  2163.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  2164.  
  2165.                                     if(Node->Special.Box.Lines)
  2166.                                     {
  2167.                                         STRPTR From,To;
  2168.                                         LONG Len;
  2169.  
  2170.                                         From = BoxLine;
  2171.  
  2172.                                         for(i = 0 ; i < Count ; i++)
  2173.                                         {
  2174.                                             for(To = From ; *To ; To++)
  2175.                                             {
  2176.                                                 if(*To == '\n')
  2177.                                                     break;
  2178.                                             }
  2179.  
  2180.                                             Len = (LONG)(To - From);
  2181.  
  2182.                                             if(Node->Special.Box.Lines[i] = LTP_Alloc(Handle,Len + 1))
  2183.                                             {
  2184.                                                 if(Len)
  2185.                                                     CopyMem(From,Node->Special.Box.Lines[i],Len);
  2186.  
  2187.                                                 Node->Special.Box.Lines[i][Len] = 0;
  2188.  
  2189.                                                 From = To + 1;
  2190.                                             }
  2191.                                         }
  2192.                                     }
  2193.                                 }
  2194.                             }
  2195.                         }
  2196.                     }
  2197.  
  2198.                     break;
  2199.             }
  2200.  
  2201.             if((FirstLabel != -1 && LastLabel != -1) || LabelTable)
  2202.             {
  2203.                 if(!Handle->LocaleHook)
  2204.                     Handle->Failed = TRUE;
  2205.                 else
  2206.                 {
  2207.                     if(Type == LISTVIEW_KIND)
  2208.                     {
  2209.                         struct List *SomeList;
  2210.  
  2211.                         if(SomeList = (struct List *)LTP_Alloc(Handle,sizeof(struct MinList)))
  2212.                         {
  2213.                             struct Node    *SomeNode;
  2214.                             LONG         Count = (LastLabel - FirstLabel + 1),i;
  2215.  
  2216.                             NewList(SomeList);
  2217.  
  2218.                             Node->Special.List.Labels = SomeList;
  2219.  
  2220.                             if(LabelTable)
  2221.                             {
  2222.                                 while(*LabelTable != -1)
  2223.                                 {
  2224.                                     if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node)))
  2225.                                     {
  2226.                                         SomeNode->ln_Name = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(*LabelTable++));
  2227.  
  2228.                                         AddTail(SomeList,SomeNode);
  2229.                                     }
  2230.                                 }
  2231.                             }
  2232.                             else
  2233.                             {
  2234.                                 for(i = 0 ; i < Count ; i++)
  2235.                                 {
  2236.                                     if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node)))
  2237.                                     {
  2238.                                         SomeNode->ln_Name = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLabel + i));
  2239.  
  2240.                                         AddTail(SomeList,SomeNode);
  2241.                                     }
  2242.                                 }
  2243.                             }
  2244.                         }
  2245.                     }
  2246.                     else
  2247.                     {
  2248.                         if(Type == MX_KIND || Type == CYCLE_KIND || Type == POPUP_KIND || Type == TAB_KIND || Type == BOX_KIND || Type == BUTTON_KIND)
  2249.                         {
  2250.                             STRPTR    *Labels;
  2251.                             LONG     Count,i;
  2252.  
  2253.                             if(LabelTable)
  2254.                             {
  2255.                                 LONG *Index = LabelTable;
  2256.  
  2257.                                 for(Count = 0 ; *Index != -1 ; Count++, Index++);
  2258.                             }
  2259.                             else
  2260.                                 Count = (LastLabel - FirstLabel + 1);
  2261.  
  2262.                             if(Labels = LTP_Alloc(Handle,sizeof(STRPTR) * (Count + 1)))
  2263.                             {
  2264.                                 if(LabelTable)
  2265.                                 {
  2266.                                     for(i = 0 ; i < Count ; i++)
  2267.                                         Labels[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(*LabelTable++));
  2268.                                 }
  2269.                                 else
  2270.                                 {
  2271.                                     for(i = 0 ; i < Count ; i++)
  2272.                                         Labels[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLabel + i));
  2273.                                 }
  2274.  
  2275.                                 Labels[i] = NULL;
  2276.  
  2277.                                 switch(Type)
  2278.                                 {
  2279.                                     case BUTTON_KIND:
  2280.  
  2281.                                         Node->Special.Button.Lines = Labels;
  2282.                                         break;
  2283.  
  2284.                                     case MX_KIND:
  2285.  
  2286.                                         Node->Special.Radio.Choices = Labels;
  2287.                                         break;
  2288.  
  2289.                                     case CYCLE_KIND:
  2290.  
  2291.                                         Node->Special.Cycle.Choices = Labels;
  2292.                                         break;
  2293.  
  2294.                                     #ifdef DO_POPUP_KIND
  2295.                                     {
  2296.                                         case POPUP_KIND:
  2297.  
  2298.                                             Node->Special.Popup.Choices = Labels;
  2299.                                             break;
  2300.                                     }
  2301.                                     #endif
  2302.  
  2303.                                     #ifdef DO_TAB_KIND
  2304.                                     {
  2305.                                         case TAB_KIND:
  2306.  
  2307.                                             Node->Special.Tab.Choices = Labels;
  2308.                                             break;
  2309.                                     }
  2310.                                     #endif
  2311.  
  2312.                                     case BOX_KIND:
  2313.  
  2314.                                         if(!Node->Special.Box.Lines)
  2315.                                         {
  2316.                                             if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  2317.                                             {
  2318.                                                 LONG i;
  2319.  
  2320.                                                 for(i = 0 ; i < Count ; i++)
  2321.                                                     Node->Special.Box.Lines[i] = "";
  2322.                                             }
  2323.                                         }
  2324.  
  2325.                                         Node->Lines = Count;
  2326.  
  2327.                                         Node->Special.Box.Labels = Labels;
  2328.  
  2329.                                         break;
  2330.                                 }
  2331.                             }
  2332.                         }
  2333.                     }
  2334.                 }
  2335.             }
  2336.  
  2337.             switch(Type)
  2338.             {
  2339.                 case BUTTON_KIND:
  2340.  
  2341.                     if(!Node->NoKey && !Node->Special.Button.KeyStroke && (Node->Special.Button.Lines || Node->Special.Button.ReturnKey))
  2342.                     {
  2343.                         LTP_ReplaceLabelShortcut(Handle,Node);
  2344.                     }
  2345.  
  2346.                     break;
  2347.  
  2348.                 case BOX_KIND:
  2349.  
  2350.                     if(Node->Special.Box.ReserveSpace)
  2351.                     {
  2352.                         LONG    Size;
  2353.                         STRPTR    Buffer;
  2354.  
  2355.                         if(!Node->Special.Box.Lines)
  2356.                         {
  2357.                             if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Node->Lines))
  2358.                             {
  2359.                                 LONG i;
  2360.  
  2361.                                 for(i = 0 ; i < Node->Lines ; i++)
  2362.                                     Node->Special.Box.Lines[i] = "";
  2363.                             }
  2364.                         }
  2365.  
  2366.                         if(!Node->Chars)
  2367.                             Size = 10;
  2368.                         else
  2369.                             Size = Node->Chars;
  2370.  
  2371.                         Node->Special.Box.MaxSize = Size;
  2372.  
  2373.                         if(Buffer = (STRPTR)LTP_Alloc(Handle,(Size + 1) * Node->Lines))
  2374.                         {
  2375.                             LONG i,Len;
  2376.  
  2377.                             for(i = 0 ; i < Node->Lines ; i++)
  2378.                             {
  2379.                                 if(Node->Special.Box.Lines[i])
  2380.                                 {
  2381.                                     Len = strlen(Node->Special.Box.Lines[i]);
  2382.  
  2383.                                     if(Len > Size)
  2384.                                         Len = Size;
  2385.  
  2386.                                     CopyMem(Node->Special.Box.Lines[i],Buffer,Len);
  2387.  
  2388.                                     Buffer[Len] = 0;
  2389.                                 }
  2390.                                 else
  2391.                                     Buffer[0] = 0;
  2392.  
  2393.                                 Node->Special.Box.Lines[i] = Buffer;
  2394.  
  2395.                                 Buffer += Size + 1;
  2396.                             }
  2397.                         }
  2398.                     }
  2399.  
  2400.                     break;
  2401.  
  2402.                 case XBAR_KIND:
  2403.                 case YBAR_KIND:
  2404.  
  2405.                     Node->Special.Bar.Parent = Handle->CurrentGroup;
  2406.                     break;
  2407.  
  2408.                 #ifdef DO_PASSWORD_KIND
  2409.                 {
  2410.                     case PASSWORD_KIND:
  2411.                     {
  2412.                         STRPTR Buffer;
  2413.  
  2414.                         if(Buffer = LTP_Alloc(Handle,2 * (Node->Special.String.MaxChars + 1)))
  2415.                         {
  2416.                             Node->Special.String.RealString    = Buffer;
  2417.                             Node->Special.String.Original    = Buffer + Node->Special.String.MaxChars + 1;
  2418.  
  2419.                             if(Node->Special.String.String)
  2420.                             {
  2421.                                 strcpy(Node->Special.String.RealString,Node->Special.String.String);
  2422.                                 strcpy(Node->Special.String.Original,Node->Special.String.String);
  2423.                             }
  2424.                         }
  2425.  
  2426.                         break;
  2427.                     }
  2428.                 }
  2429.                 #endif
  2430.  
  2431.                 case FRACTION_KIND:
  2432.  
  2433.                     Node->Special.String.RealString = LTP_Alloc(Handle,Node->Special.String.MaxChars + 1);
  2434.                     break;
  2435.             }
  2436.  
  2437.             if(ParentList)
  2438.                 AddTail((struct List *)ParentList,(struct Node *)Node);
  2439.         }
  2440.     }
  2441. }
  2442.  
  2443.  
  2444. /*****************************************************************************/
  2445.  
  2446.  
  2447. /****** gtlayout.library/LT_NewA ******************************************
  2448. *
  2449. *   NAME
  2450. *    LT_NewA -- Add a new object to the user interface tree.
  2451. *
  2452. *   SYNOPSIS
  2453. *    LT_NewA(Handle,Tags);
  2454. *             A0    A1
  2455. *
  2456. *    VOID LT_NewA(LayoutHandle *,struct TagItem *);
  2457. *
  2458. *    LT_New(Handle,...);
  2459. *
  2460. *    VOID LT_New(LayoutHandle *,...);
  2461. *
  2462. *   FUNCTION
  2463. *    LT_NewA() is the routine you use to build the user interface,
  2464. *    you give layout directions, design groups, etc. and finally
  2465. *    call LT_BuildA() to turn these specifications into a window.
  2466. *
  2467. *   INPUTS
  2468. *    Handle - Pointer to LayoutHandle structure.
  2469. *
  2470. *
  2471. *    This routine will accept almost all create-time tag items
  2472. *    gadtools.library/CreateGadget will handle. In addition to
  2473. *    this there are a bunch of extra gadget objects and extra
  2474. *    tag items supported:
  2475. *
  2476. *    All object types:
  2477. *
  2478. *        LA_Type (LONG) - Type of the object to create, must be
  2479. *            one of the following:
  2480. *
  2481. *                TEXT_KIND
  2482. *                VERTICAL_KIND
  2483. *                HORIZONTAL_KIND
  2484. *                END_KIND
  2485. *                FRAME_KIND
  2486. *                BOX_KIND
  2487. *                SLIDER_KIND
  2488. *                LISTVIEW_KIND
  2489. *                INTEGER_KIND
  2490. *                STRING_KIND
  2491. *                PASSWORD_KIND
  2492. *                PALETTE_KIND
  2493. *                BUTTON_KIND
  2494. *                CHECKBOX_KIND
  2495. *                NUMBER_KIND
  2496. *                GAUGE_KIND
  2497. *                CYCLE_KIND
  2498. *                POPUP_KIND
  2499. *                TAB_KIND
  2500. *                MX_KIND
  2501. *                XBAR_KIND
  2502. *                YBAR_KIND
  2503. *                TAPEDECK_KIND
  2504. *                LEVEL_KIND
  2505. *                BOOPSI_KIND
  2506. *                BLANK_KIND (V36)
  2507. *                FRACTION_KIND (V38)
  2508. *                IMAGE_KIND (V41)
  2509. *
  2510. *        LA_LabelText (STRPTR) - The object label text to use.
  2511. *
  2512. *        LA_LabelID (LONG) - The locale text ID of the string to
  2513. *            use as the object label text.
  2514. *
  2515. *                NOTE: LT_NewA() will fail if you forget
  2516. *                    to select a hook with LAHN_LocaleHook
  2517. *                    at LT_CreateHandleTagList.
  2518. *
  2519. *        LA_ID (LONG) - The gadget ID to use for this object.
  2520. *
  2521. *                NOTE: User ID values *MUST* be greater than 0,
  2522. *                      negative values are reserved for internal
  2523. *                      use.
  2524. *
  2525. *        LA_Chars (LONG) - The width of this object measured in
  2526. *            characters. If each character of the user interface
  2527. *            font is 8 pixels wide an object with LA_Chars set to
  2528. *            10 will usually be 80 pixels wide.
  2529. *
  2530. *        LA_LabelChars (LONG) - This forces the internal gadget
  2531. *            label width the layout engine calculates during the
  2532. *            layout pass to a specific value. Note: this does
  2533. *            not work well with all objects. (V9)
  2534. *
  2535. *        LA_LabelPlace (LONG) - Where to place the gadget label.
  2536. *            Not all objects will support all label positions:
  2537. *
  2538. *                PLACE_LEFT - Place label text left of object
  2539. *                PLACE_RIGHT - Place label text right of object
  2540. *                PLACE_ABOVE - Place label text above object
  2541. *                PLACE_IN - Place label text in object
  2542. *                PLACE_BELOW - Place label text below object
  2543. *
  2544. *        LA_ExtraSpace (BOOL) - Add extra vertical/horizontal
  2545. *            space before this object.
  2546. *            Default: FALSE
  2547. *
  2548. *        LA_ExtraFat (BOOL) - Make this object a bit larger
  2549. *            than its usual size.
  2550. *            Default: FALSE
  2551. *
  2552. *        LA_NoKey (BOOL) - Don't let the user interface choose
  2553. *            a keyboard shortcut for this object.
  2554. *            Default: FALSE
  2555. *
  2556. *        LA_HighLabel (BOOL) - Use highlight pen when rendering
  2557. *            the gadget label text.
  2558. *            Default: FALSE
  2559. *
  2560. *        LA_BYTE (BYTE *) - Pointer to the variable that holds
  2561. *            the "current value" of the object. The layout engine
  2562. *            will retrieve this value initially during the creation
  2563. *            of the object and maintain it during its lifespan.
  2564. *            This means you do not need to worry about checking
  2565. *            the state of the object, the user interface layout
  2566. *            engine will do it for you.
  2567. *
  2568. *        LA_UBYTE (UBYTE *) - Pointer to the variable that holds
  2569. *            the "current value" of the object. The layout engine
  2570. *            will retrieve this value initially during the creation
  2571. *            of the object and maintain it during its lifespan.
  2572. *            This means you do not need to worry about checking
  2573. *            the state of the object, the user interface layout
  2574. *            engine will do it for you.
  2575. *
  2576. *        LA_WORD (WORD *) - Pointer to the variable that holds
  2577. *            the "current value" of the object. The layout engine
  2578. *            will retrieve this value initially during the creation
  2579. *            of the object and maintain it during its lifespan.
  2580. *            This means you do not need to worry about checking
  2581. *            the state of the object, the user interface layout
  2582. *            engine will do it for you.
  2583. *
  2584. *        LA_UWORD (UWORD *) - Pointer to the variable that holds
  2585. *            the "current value" of the object. The layout engine
  2586. *            will retrieve this value initially during the creation
  2587. *            of the object and maintain it during its lifespan.
  2588. *            This means you do not need to worry about checking
  2589. *            the state of the object, the user interface layout
  2590. *            engine will do it for you.
  2591. *
  2592. *        LA_BOOL (BOOL *) - Pointer to the variable that holds
  2593. *            the "current value" of the object. The layout engine
  2594. *            will retrieve this value initially during the creation
  2595. *            of the object and maintain it during its lifespan.
  2596. *            This means you do not need to worry about checking
  2597. *            the state of the object, the user interface layout
  2598. *            engine will do it for you.
  2599. *
  2600. *        LA_LONG (LONG *) - Pointer to the variable that holds
  2601. *            the "current value" of the object. The layout engine
  2602. *            will retrieve this value initially during the creation
  2603. *            of the object and maintain it during its lifespan.
  2604. *            This means you do not need to worry about checking
  2605. *            the state of the object, the user interface layout
  2606. *            engine will do it for you.
  2607. *
  2608. *        LA_ULONG (ULONG *) - Pointer to the variable that holds
  2609. *            the "current value" of the object. The layout engine
  2610. *            will retrieve this value initially during the creation
  2611. *            of the object and maintain it during its lifespan.
  2612. *            This means you do not need to worry about checking
  2613. *            the state of the object, the user interface layout
  2614. *            engine will do it for you.
  2615. *
  2616. *        LA_STRPTR (STRPTR) - Pointer to the variable that holds
  2617. *            the "current value" of the object. The layout engine
  2618. *            will retrieve this value initially during the creation
  2619. *            of the object and maintain it during its lifespan.
  2620. *            This means you do not need to worry about checking
  2621. *            the state of the object, the user interface layout
  2622. *            engine will do it for you.
  2623. *
  2624. *        LA_FRACTION (FRACTION *) - Pointer to the variable that holds
  2625. *            the "current value" of the object. The layout engine
  2626. *            will retrieve this value initially during the creation
  2627. *            of the object and maintain it during its lifespan.
  2628. *            This means you do not need to worry about checking
  2629. *            the state of the object, the user interface layout
  2630. *            engine will do it for you.
  2631. *
  2632. *
  2633. *        BLANK_KIND (transparent placeholder):
  2634. *
  2635. *            (requires gtlayout.library V36 or higher)
  2636. *
  2637. *            No tags are defined for this type of object.
  2638. *
  2639. *
  2640. *        BOOPSI_KIND:
  2641. *
  2642. *            (requires gtlayout.library V10 or higher)
  2643. *
  2644. *            LABO_TagCurrent (Tag) - The Tag ID that represents the
  2645. *                current object value. For PROPGCLASS this would be
  2646. *                PGA_Top.
  2647. *
  2648. *            LABO_TagTextAttr (Tag) - The Tag ID that represents the
  2649. *                TextAttr value the object expects. For gadgets this
  2650. *                would be GA_TextAttr.
  2651. *
  2652. *            LABO_TagDrawInfo (Tag) - The Tag ID that represents the
  2653. *                DrawInfo value the object expects.
  2654. *
  2655. *            LABO_TagLink (Tag) - The Tag ID that represents a pointer
  2656. *                to a different object the object expects. For the
  2657. *                colorwheel.gadget this would be WHEEL_GradientSlider.
  2658. *
  2659. *            LABO_TagScreen (Tag) - The Tag ID that represents the
  2660. *                screen the object expects. For the colorwheel.gadget
  2661. *                this would be WHEEL_Screen.
  2662. *
  2663. *            LABO_Link (LONG) - The ID of the object this object should
  2664. *                be linked to. This will be resolved later when gadgets
  2665. *                are created.
  2666. *
  2667. *                    NOTE: Forward references are not resolved, only
  2668. *                        backward references are allowed. This means that
  2669. *                        if you wish to link object A to object B,
  2670. *                        object A must be created before object B
  2671. *                        is created.
  2672. *
  2673. *            LABO_ClassInstance (Class *) - This is the first parameter
  2674. *                you would pass to NewObjectA().
  2675. *
  2676. *                    NOTE: Only classes derived from gadgetclass and
  2677. *                      gadgetclass itself may be used.
  2678. *
  2679. *            LABO_ClassName (STRPTR) - This is the second parameter you would
  2680. *                pass to NewObject().
  2681. *
  2682. *                    NOTE: Only classes derived from gadgetclass and
  2683. *                        gadgetclass itself may be used.
  2684. *
  2685. *            LABO_ClassLibraryName (STRPTR) - This tag is particularly useful
  2686. *                for gadget class implementations wrapped into libraries, such as
  2687. *                colorwheel.gadget. When opened, they make the classes they
  2688. *                represent publicly available so subsequent calls to
  2689. *                NewObject(NULL,<Classname>,...) can be made. The
  2690. *                LABO_ClassLibraryName tag will cause gtlayout.library to open
  2691. *                the class library before any calls to NewObject() are made.
  2692. *
  2693. *                    NOTE: Only classes derived from gadgetclass and
  2694. *                        gadgetclass itself may be used.
  2695. *
  2696. *                        The LABO_ClassLibraryName tag requires that you
  2697. *                        specify the class name with the LABO_ClassName. It is
  2698. *                        not enough to just use the LABO_ClassLibraryName tag.
  2699. *
  2700. *            LABO_ExactWidth (WORD) - This is the exact width of the object to
  2701. *                use. This effectively overrides whatever you specified using
  2702. *                the LA_Chars tag and keeps gtlayout.library from shrinking and
  2703. *                expanding the object as needed.
  2704. *
  2705. *            LABO_ExactHeight (WORD) - This is the exact height of the object to
  2706. *                use. This effectively overrides whatever you specified using
  2707. *                the LA_Lines tag and keeps gtlayout.library from shrinking and
  2708. *                expanding the object as needed.
  2709. *
  2710. *            LABO_RelFontHeight (WORD) - This tag affects the height of the
  2711. *                object; when specified, it is derived from the user interface
  2712. *                font height plus the value given with LABO_RelFontHeight.
  2713. *
  2714. *            LABO_FullWidth (BOOL) - Use this tag if you wish the object to
  2715. *                cover the entire width of the group it resides within.
  2716. *
  2717. *            LABO_FullHeight (BOOL) - Use this tag if you wish the object to
  2718. *                cover the entire height of the group it resides within.
  2719. *
  2720. *            LABO_ActivateHook (struct Hook *) - Hook to invoke when the
  2721. *                layout engine decides that this particular object should
  2722. *                be activated. The hook is called with the following
  2723. *                parameters:
  2724. *
  2725. *                Success = ActivateFunc(struct Hook *Hook,LayoutHandle *Handle,
  2726. *                  D0                                 A0                  A2
  2727. *
  2728. *                             Object *object)
  2729. *                                       A1
  2730. *
  2731. *                The object pointer actually refers to the instance of the
  2732. *                BOOPSI object created. Return FALSE if your object could not
  2733. *                be activated, TRUE if it worked. If you return TRUE, no special
  2734. *                keyboard event will be generated. (V13)
  2735. *
  2736. *            NOTE: All tags passed to LT_New() for BOOPSI_KIND objects are
  2737. *                passed through to NewObjectA() later. The library makes
  2738. *                a copy of the tag item list, so all data valid in the
  2739. *                scope when LT_New() is called must also be valid later
  2740. *                when LT_Build() is invoked.
  2741. *
  2742. *                The gadget label is *NOT* passed through to the object,
  2743. *                it effectively receives the label a plain gadtools object
  2744. *                would receive, similar to what happens to FRAME_KIND
  2745. *                objects and the like.
  2746. *
  2747. *
  2748. *        BOX_KIND (multiline text display):
  2749. *
  2750. *            LABX_Chars (LONG) - The width of this object in
  2751. *                characters. The layout routine will try to make
  2752. *                sure that the given number of characters will
  2753. *                fit into a single line of text in this box.
  2754. *                This may be a problem with proportional spaced
  2755. *                fonts.
  2756. *               Default: 10
  2757. *
  2758. *            LABX_Labels (STRPTR *) - The label texts to display
  2759. *                on the right hand side of the box. Terminate
  2760. *                this array with NULL.
  2761. *
  2762. *            LABX_Lines (STRPTR *) - The text to display in the
  2763. *                box. Terminate this array with NULL.
  2764. *
  2765. *            LABX_Rows (LONG) - The height of this object in
  2766. *                characters.
  2767. *
  2768. *            LABX_AlignText (LONG) - Controls how text is aligned
  2769. *                in box lines:
  2770. *
  2771. *                    ALIGNTEXT_LEFT - Align text to the left edge
  2772. *                    ALIGNTEXT_CENTERED - Centre the text
  2773. *                    ALIGNTEXT_RIGHT - Align text to the right edge
  2774. *                    ALIGNTEXT_PAD - Pad text lines
  2775. *
  2776. *                Default: ALIGNTEXT_LEFT
  2777. *
  2778. *            LABX_DrawBox (BOOL) - Draw a recessed bevel box
  2779. *                around the text box.
  2780. *                Default: FALSE
  2781. *
  2782. *            LABX_FirstLabel (LONG) - Locale string ID of the first
  2783. *                text to use as a box label. Works in conjunction
  2784. *                with LABX_LastLabel.
  2785. *
  2786. *            LABX_LastLabel (LONG) - Locale string ID of the last
  2787. *                text to use as a box label. Works in conjunction
  2788. *                with LABX_FirstLabel. When building the interface the
  2789. *                code will loop from FirstLabel..LastLabel, look
  2790. *                up the corresponding locale strings and use the
  2791. *                data to make up the label text to appear at the
  2792. *                right hand side of the box.
  2793. *
  2794. *            LABX_LabelTable (LONG *) - Pointer to an array of IDs
  2795. *                to use for building the box labels. This requires
  2796. *                that a locale hook is provided with the layout handle.
  2797. *                The array is terminated by -1.
  2798. *
  2799. *            LABX_ReserveSpace (BOOL) - Allocate extra memory to hold
  2800. *                the contents of the lines displayed. This avoids nasty
  2801. *                side-effects when refreshing this object.
  2802. *                Default: FALSE
  2803. *
  2804. *            LABX_FirstLine (LONG) - Locale string ID of the first
  2805. *                text to print inside the box. Works in conjunction
  2806. *                with LABX_LastLine. (V26)
  2807. *
  2808. *            LABX_LastLine (LONG) - Locale string ID of the last
  2809. *                text to print inside the box. Works in conjunction
  2810. *                with LABX_FirstLine. (V26)
  2811. *
  2812. *            LABX_LineTable (LONG *) - Pointer to an array of IDs
  2813. *                to use for building the box contents lines. This requires
  2814. *                that a locale hook is provided with the layout handle.
  2815. *                The array is terminated by -1. (V28)
  2816. *
  2817. *            LABX_Line (STRPTR) - Line to display in the box, may
  2818. *                contain '\n' line break characters, the layout engine
  2819. *                will chop the single line into single consecutive lines
  2820. *                following the '\n' chars. (V31)
  2821. *
  2822. *            LABX_LineID (LONG) - Locale ID of line text to display in the
  2823. *                box, may contain '\n' line break characters, the layout
  2824. *                engine will chop the single line into single consecutive lines
  2825. *                following the '\n' chars. (V31)
  2826. *
  2827. *            LABX_TextPen (WORD) - Box text colour to use. (V40)
  2828. *
  2829. *            LABX_BackPen (WORD) - Box text background colour to use. (V40)
  2830. *
  2831. *            LABX_Spacing (UWORD) - Request that additional pixels should
  2832. *                separate lines of text. (V41)
  2833. *                Default: 0
  2834. *
  2835. *
  2836. *        BUTTON_KIND:
  2837. *
  2838. *            LA_Label (STRPTR)
  2839. *            LA_LabelID (LONG) - These two define the button label, i.e.
  2840. *                the text that is printed within the button box. Optionally,
  2841. *                this text may include newline characters ("\n") which will
  2842. *                cause the button text to be broken into several lines.
  2843. *                This particular feature requires gtlayout.library v12 or
  2844. *                higher. Single line label have always been supported.
  2845. *
  2846. *            LABT_ReturnKey (BOOL) - Let the user operate this
  2847. *                button by pressing the return key, making it the
  2848. *                so-called default button, or default choice. The
  2849. *                button select box will appear slightly bolder than
  2850. *                normal buttons are.
  2851. *
  2852. *                    NOTE: there can be only one single button per
  2853. *                        window to sport this feature.
  2854. *
  2855. *                Default: FALSE
  2856. *
  2857. *            LABT_EscKey (BOOL) - Let the user operate this
  2858. *                button by pressing the Escape key.
  2859. *
  2860. *                    NOTE: there can be only one single button per
  2861. *                        window to use this feature.
  2862. *
  2863. *                Default: FALSE
  2864. *
  2865. *            LABT_ExtraFat (BOOL) - Make this button a bit
  2866. *                larger than usual.
  2867. *                Default: FALSE
  2868. *
  2869. *            LABT_Lines (STRPTR *) - Use the given string array
  2870. *                to create a multiline gadget label. Terminate the
  2871. *                array with a NULL. (V12)
  2872. *
  2873. *            LABT_FirstLine (LONG) - Locale ID of first label line. (V12)
  2874. *
  2875. *            LABT_LastLine (LONG) - Locale ID of last label line. (V12)
  2876. *
  2877. *            LABT_DefaultCorrection (BOOL) - Make the button slightly
  2878. *                wider and taller so its size matches the default
  2879. *                button. (V21)
  2880. *
  2881. *            LABT_Smaller (BOOL) - Make this button a little smaller
  2882. *                than usual. (V21)
  2883. *
  2884. *
  2885. *        CYCLE_KIND:
  2886. *
  2887. *            LACY_FirstLabel (LONG) - Locale string ID of the first
  2888. *                text to use as a label. Works in conjunction
  2889. *                with LACY_LastLabel.
  2890. *
  2891. *            LACY_LastLabel (LONG) - Locale string ID of the last
  2892. *                text to use as a label. Works in conjunction
  2893. *                with LACY_FirstLabel. When building the interface the
  2894. *                code will loop from FirstLabel..LastLabel, look
  2895. *                up the corresponding locale strings and use the
  2896. *                data to make up the label text.
  2897. *
  2898. *            LACY_LabelTable (LONG *) - Pointer to an array of IDs
  2899. *                to use for building the cycle labels. This requires
  2900. *                that a locale hook is provided with the layout handle.
  2901. *                The array is terminated by -1.
  2902. *
  2903. *            LACY_TabKey (BOOL) - Connect this object to the tabulator
  2904. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  2905. *                to cycle to the previous entry. (V9)
  2906. *
  2907. *                    NOTE: there can be only one single button per
  2908. *                        window to use this feature.
  2909. *
  2910. *                Default: FALSE
  2911. *
  2912. *            LACY_AutoPageID (LONG) - ID of paged GROUP_KIND object
  2913. *                which will be set to the gadget's current setting.
  2914. *                If this tag is set, you will hear no events from this
  2915. *                object any more. (V7)
  2916. *
  2917. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  2918. *                        which may be generated if the layout
  2919. *                        engine runs out of memory when rebuilding
  2920. *                        the user interface.
  2921. *
  2922. *
  2923. *        FRACTION_KIND:
  2924. *
  2925. *            (requires gtlayout.library V38 or higher)
  2926. *
  2927. *            This is a special kind of STRING_KIND which comes with a
  2928. *            special input filter. It will allow only for floating point
  2929. *            numbers to be entered, i.e. numbers (`0'-`9') and one
  2930. *            decimal point (`.' or whatever your current locale uses
  2931. *            as the decimal point character). What you will receive as
  2932. *            user input text will be in the following format:
  2933. *
  2934. *                (0|#[0-9]).(0|#[0-9])
  2935. *
  2936. *            Or in other words, text like this will be returned:
  2937. *
  2938. *                0.0
  2939. *                7.0
  2940. *                0.9
  2941. *                146654.0
  2942. *
  2943. *            NOTE: While this object type did exist in earlier library
  2944. *                  versions support for it was removed in V33. It was
  2945. *                  eventually reintroduced with the functionality described
  2946. *                  above in V38.
  2947. *
  2948. *            LAFR_IncrementerHook (struct Hook *) - Hook to invoke when the
  2949. *                incrementer arrows are used. The hook function will receive
  2950. *                three parameters and has to return a result code:
  2951. *
  2952. *                    a0 - (struct Hook *)  Pointer to this hook
  2953. *                    a2 - (STRPTR) Current value of this object
  2954. *                    a1 - (LONG) Either INCREMENTERMSG_Decrement or
  2955. *                                INCREMENTERMSG_Increment
  2956. *
  2957. *                If the hook function modifies the current value it must
  2958. *                return TRUE, otherwise FALSE must be returned. If you return
  2959. *                TRUE, then the library will update the object. (V40)
  2960. *
  2961. *            This object type accepts all the GTST_#? tag items.
  2962. *
  2963. *
  2964. *        FRAME_KIND (fixed size general purpose display,
  2965. *            you may render into it):
  2966. *
  2967. *            LAFR_InnerWidth (LONG) - Inner width of the
  2968. *                display box.
  2969. *
  2970. *            LAFR_InnerHeight (LONG) - Inner height of the
  2971. *                display box.
  2972. *
  2973. *            LAFR_DrawBox (BOOL) - Draw a recessed bevel box
  2974. *                around the display box.
  2975. *                Default: FALSE
  2976. *
  2977. *            LAFR_RefreshHook (struct Hook *) - Hook to call
  2978. *                when refreshing/redrawing this object. See
  2979. *                gtlayout.h for more information. (V9)
  2980. *
  2981. *            LAFR_GenerateEvents (BOOL) - If TRUE, clicking
  2982. *                inside the FRAME_KIND object will generate
  2983. *                IDCMP_GADGETUP/IDCMP_GADGETDOWN events. If
  2984. *                you wish to know where the click occured,
  2985. *                make a copy of the Window->MouseX/Y entries
  2986. *                before you call LT_HandleInput()/LT_GetIMsg(). (V28)
  2987. *                Default: FALSE
  2988. *
  2989. *            LAFR_ResizeX (BOOL) - Makes this frame resizable
  2990. *                in the horizontal direction, attaches a sizing
  2991. *                gadget to the window to open and handles window
  2992. *                resize operations automatically. (V44)
  2993. *
  2994. *                    NOTE: there can be only one single object
  2995. *                        per window to sport this feature. This
  2996. *                        means that you won't be able to have
  2997. *                        both a resizable listview and a resizable
  2998. *                        frame in the same window.
  2999. *
  3000. *                        Also listen to IDCMP_CLOSEWINDOW events
  3001. *                        which may be generated if the layout
  3002. *                        engine runs out of memory when rebuilding
  3003. *                        the user interface.
  3004. *
  3005. *                Default: FALSE
  3006. *
  3007. *            LAFR_ResizeY (BOOL) - Makes this frame resizable
  3008. *                in the vertical direction, attaches a sizing
  3009. *                gadget to the window to open and handles window
  3010. *                resize operations automatically. (V44)
  3011. *
  3012. *                    NOTE: there can be only one single object
  3013. *                        per window to sport this feature. This
  3014. *                        means that you won't be able to have
  3015. *                        both a resizable listview and a resizable
  3016. *                        frame in the same window.
  3017. *
  3018. *                        Also listen to IDCMP_CLOSEWINDOW events
  3019. *                        which may be generated if the layout
  3020. *                        engine runs out of memory when rebuilding
  3021. *                        the user interface.
  3022. *
  3023. *                Default: FALSE
  3024. *
  3025. *        GAUGE_KIND (general purpose progress report display):
  3026. *
  3027. *            LAGA_Percent (LONG) - Indicator position, can range
  3028. *                from 0..100.
  3029. *                Default: 0
  3030. *
  3031. *            LAGA_InfoLength (LONG) - Maximum number of characters
  3032. *                to reserve for text printed in the gauge display.
  3033. *                Default: 0
  3034. *
  3035. *            LAGA_InfoText (STRPTR) - Text to print in the gauge
  3036. *                display.
  3037. *
  3038. *            LAGA_Tenth (BOOL) - Instead of a continuously growing
  3039. *                bar you will get a set of exactly ten blocks,
  3040. *                each separated by a hairline. (V19)
  3041. *                Default: FALSE
  3042. *
  3043. *               LAGA_NoTicks (BOOL) - If TRUE suppresses drawing the
  3044. *                   ticks below the gauge box.
  3045. *                   Default: FALSE
  3046. *
  3047. *
  3048. *        IMAGE_KIND (display area for Image or BitMap data):
  3049. *
  3050. *            (requires gtlayout.library V41 or higher)
  3051. *
  3052. *            LAIM_Image (struct Image *) - Image to draw in this
  3053. *                place. When the user interface is built, it will
  3054. *                be drawn using intuition.library/DrawImage().
  3055. *
  3056. *            LAIM_BitMap (struct BitMap *) - You can supply a
  3057. *                BitMap instead of an Image which will be drawn
  3058. *                using either graphics.library/BltBitMapRastPort()
  3059. *                or graphics.library/BltMaskBitMapRastPort() if
  3060. *                a mask is provided.
  3061. *
  3062. *            LAIM_BitMapLeft (UWORD) - Left corner of the image data
  3063. *                to blit into the window (the second parameter for
  3064. *                BltBitMapRastPort()).
  3065. *
  3066. *            LAIM_BitMapTop (UWORD) - Top corner of the image data
  3067. *                to blit into the window (the third parameter for
  3068. *                BltBitMapRastPort()).
  3069. *
  3070. *            LAIM_BitMapWidth (UWORD) - Width of the bitmap area to
  3071. *                blit into the window.
  3072. *
  3073. *            LAIM_BitMapHeight (UWORD) - Height of the bitmap area to
  3074. *                blit into the window.
  3075. *
  3076. *            LAIM_BitMapMask (PLANEPTR) - Pointer to a bit plane mask
  3077. *                to blit the image bitmap through. Must follow the
  3078. *                rules documented for for BltMaskBitMapRastPort().
  3079. *                The blit operation will use the minterm for
  3080. *                transparency.
  3081. *
  3082. *
  3083. *        INTEGER_KIND:
  3084. *
  3085. *            LAIN_LastGadget (BOOL) - Pressing return with this
  3086. *                gadget active will stop activating the next
  3087. *                following string gadget type if TRUE is passed.
  3088. *                Default: FALSE
  3089. *
  3090. *            LAIN_Min (LONG) - Minimum accepted numeric value.
  3091. *                Default: -2147483647
  3092. *
  3093. *            LAIN_Max (LONG) - Maximum accepted numeric value.
  3094. *                Default:  2147483647
  3095. *
  3096. *            LAIN_UseIncrementers (BOOL) - Use TRUE to add incrementer
  3097. *                arrow buttons to the right of the numeric entry field.
  3098. *                These buttons will let you cycle through a set of
  3099. *                numbers to be displayed in the numeric entry field.
  3100. *                Default: FALSE
  3101. *
  3102. *            LAIN_HistoryLines (LONG) - Number of numbers entered to
  3103. *                keep as a backlog.
  3104. *                Default: 0
  3105. *
  3106. *            LAIN_HistoryHook (struct Hook *) - Hook code to call when
  3107. *                entering a number into the backlog. See gtlayout.h for
  3108. *                more information.
  3109. *                Default: NULL
  3110. *
  3111. *            LAIN_IncrementerHook (struct Hook *) - Hook code to call
  3112. *                when cycling through numeric values. See gtlayout.h for
  3113. *                more information.
  3114. *                Default: NULL
  3115. *
  3116. *            LAIN_Activate (BOOL) - When the window opens, make this
  3117. *                gadget the active one. (V21)
  3118. *
  3119. *                    NOTE: There can be only one gadget of this type
  3120. *                        per window.
  3121. *
  3122. *                Default: FALSE
  3123. *
  3124. *
  3125. *        LEVEL_KIND:
  3126. *
  3127. *            All tags are supported which SLIDER_KIND supports.
  3128. *            The gadget level display however, can only be aligned
  3129. *            to the left border.
  3130. *
  3131. *            LAVL_Freedom (WORD) - Selects the orientation of the
  3132. *                slider body; can be either FREEHORIZ or FREEVERT. (V41)
  3133. *
  3134. *                Default: FREEHORIZ
  3135. *
  3136. *            LAVL_Ticks (WORD) - Selects if and where to place tick
  3137. *                marks next to the slider body. Can be one of the
  3138. *                the following: TICKS_None (no ticks), TICKS_Left
  3139. *                (place ticks left of the body), TICKS_Above (place
  3140. *                ticks above the body), TICKS_Both (place ticks on
  3141. *                both sides of the body). (V41)
  3142. *
  3143. *                Default: TICKS_None
  3144. *
  3145. *            LAVL_NumTicks (LONG) - Number of tick marks to draw. (V41)
  3146. *
  3147. *            LAVL_Lines (LONG) - Height of the slider, if FREEVERT. (V41)
  3148. *
  3149. *
  3150. *        LISTVIEW_KIND:
  3151. *
  3152. *            LALV_ExtraLabels (STRPTR *) - Place extra line
  3153. *                labels at the right of the box. Terminate
  3154. *                this array with NULL.
  3155. *
  3156. *            LALV_Labels (STRPTR *) - The labels to display
  3157. *                inside the box, you can pass this array of
  3158. *                strings in rather than passing an initialized
  3159. *                List of text via GTLV_Labels. Terminate
  3160. *                this array with NULL.
  3161. *
  3162. *            LALV_CursorKey (BOOL) - Let the user operate this
  3163. *                listview using the cursor keys.
  3164. *
  3165. *                    NOTE: there can be only one single listview
  3166. *                        per window to sport this feature.
  3167. *
  3168. *                Default: FALSE
  3169. *
  3170. *            LALV_Lines (LONG) - The number of text lines this
  3171. *                listview is to display.
  3172. *
  3173. *            LALV_Link (LONG) - The Gadget ID of a string gadget
  3174. *                to attach to this listview.
  3175. *
  3176. *                    NOTE: you need to
  3177. *                        add the Gadget in question before you add the
  3178. *                        listview to refer to it or the layout routine
  3179. *                        will get confused.
  3180. *
  3181. *                Passing the value NIL_LINK will create a listview
  3182. *                which displays the currently selected item, otherwise
  3183. *                you will get a read-only list.
  3184. *
  3185. *            LALV_FirstLabel (LONG) - Locale string ID of the first
  3186. *                text to use as a list label. Works in conjunction
  3187. *                with LALV_LastLabel.
  3188. *
  3189. *            LALV_LastLabel (LONG) - Locale string ID of the last
  3190. *                text to use as a list label. Works in conjunction
  3191. *                with LALV_FirstLabel. When building the interface the
  3192. *                code will loop from FirstLabel..LastLabel, look
  3193. *                up the corresponding locale strings and use the
  3194. *                data to make up the label text to appear in the
  3195. *                list.
  3196. *
  3197. *            LALV_LabelTable (LONG *) - Pointer to an array of IDs
  3198. *                to use for building the listview contents. This requires
  3199. *                that a locale hook is provided with the layout handle.
  3200. *                The array is terminated by -1.
  3201. *
  3202. *            LALV_MaxGrowX (LONG) - Maximum width of this object
  3203. *                measured in characters. When the first layout pass
  3204. *                is finished and there is still enough space left
  3205. *                to make the listview wider, the width is increased
  3206. *                until it hits the limit specified using this tag.
  3207. *
  3208. *                    NOTE: there can be only one single listview
  3209. *                        per window to sport this feature.
  3210. *
  3211. *                Default: 0
  3212. *
  3213. *            LALV_MaxGrowY (LONG) - Maximum height of this object
  3214. *                measured in lines. When the first layout pass is
  3215. *                finished and there is still enough space left to
  3216. *                make the listview higher, the height is increased
  3217. *                until it hits the limit specified using this tag.
  3218. *
  3219. *                    NOTE: there can be only one single listview
  3220. *                        per window to sport this feature.
  3221. *
  3222. *                Default: 0
  3223. *
  3224. *            LALV_ResizeX (BOOL) - Makes this listview resizable
  3225. *                in the horizontal direction, attaches a sizing
  3226. *                gadget to the window to open and handles window
  3227. *                resize operations automatically. (V9)
  3228. *
  3229. *                    NOTE: there can be only one single object
  3230. *                        per window to sport this feature. This
  3231. *                        means that you won't be able to have
  3232. *                        both a resizable listview and a resizable
  3233. *                        frame in the same window.
  3234. *
  3235. *                        Also listen to IDCMP_CLOSEWINDOW events
  3236. *                        which may be generated if the layout
  3237. *                        engine runs out of memory when rebuilding
  3238. *                        the user interface.
  3239. *
  3240. *                Default: FALSE
  3241. *
  3242. *            LALV_ResizeY (BOOL) - Makes this listview resizable
  3243. *                in the vertical direction, attaches a sizing
  3244. *                gadget to the window to open and handles window
  3245. *                resize operations automatically. (V9)
  3246. *
  3247. *                    NOTE: there can be only one single object
  3248. *                        per window to sport this feature. This
  3249. *                        means that you won't be able to have
  3250. *                        both a resizable listview and a resizable
  3251. *                        frame in the same window.
  3252. *
  3253. *                        Also listen to IDCMP_CLOSEWINDOW events
  3254. *                        which may be generated if the layout
  3255. *                        engine runs out of memory when rebuilding
  3256. *                        the user interface.
  3257. *
  3258. *                Default: FALSE
  3259. *
  3260. *            LALV_MinChars (WORD) - Minimum width for this
  3261. *                object, measured in characters. Used in
  3262. *                conjunction with LALV_ResizeX. (V9)
  3263. *
  3264. *            LALV_MinLines (WORD) - Minimum height for this
  3265. *                object, measured in lines. Used in
  3266. *                conjunction with LALV_ResizeY. (V9)
  3267. *
  3268. *            LALV_LockSize (BOOL) - After doing the initial layout
  3269. *                for this object, do not adapt its size again during
  3270. *                subsequent layouts. This is particularly useful if
  3271. *                you have a LISTVIEW_KIND object in a paged group
  3272. *                and keep adding new entries to the list. You need
  3273. *                to specify an object width using LA_Chars, otherwise
  3274. *                the layout engine may make it not wide enough to
  3275. *                display any entries. (V8)
  3276. *
  3277. *            LALV_FlushLabelLeft (BOOL) - For a gadget label placed
  3278. *                above the listview align the text to the left edge
  3279. *                of the view. (V9)
  3280. *
  3281. *            LALV_TextAttr (struct TextAttr *) - You can specify a
  3282. *                fixed-width font to be used for the list display.
  3283. *                The TextAttr (or TTextAttr) you provide must be ready
  3284. *                to go so the layout code can open the font later.
  3285. *
  3286. *                To get the current system default font, which is
  3287. *                guaranteed to be fixed-width, pass ~0 instead of a
  3288. *                pointer to a TextAttr structure. (V10)
  3289. *
  3290. *                    NOTE: The font *MUST* be fixed-width or the layout
  3291. *                        will fail.
  3292. *
  3293. *                         Choose your font in such a way that it matches
  3294. *                         in width and height with the other probably
  3295. *                         proportional-spaced user interface font.
  3296. *
  3297. *                         If the layout engine decides to step down in
  3298. *                         font size, all LISTVIEW_KIND objects which were
  3299. *                         configured to use a special fixed-width font
  3300. *                         will `forget' about it. This won't matter much
  3301. *                         as the fonts the engine chooses will always be
  3302. *                         fixed-width anyway.
  3303. *
  3304. *            LALV_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3305. *                which will be set to the gadget's current setting.
  3306. *                If this tag is set, you will hear no events from this
  3307. *                object any more. (V23)
  3308. *
  3309. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3310. *                        which may be generated if the layout
  3311. *                        engine runs out of memory when rebuilding
  3312. *                        the user interface.
  3313. *
  3314. *            LALV_Selected (LONG) - In this context, this tag is an
  3315. *                alias for GTLV_Selected. See
  3316. *                gtlayout.library/LT_SetAttributes for more information
  3317. *                on how the meaning of this tag differs from this (V34).
  3318. *
  3319. *
  3320. *        MX_KIND:
  3321. *
  3322. *            LAMX_FirstLabel (LONG) - Locale string ID of the first
  3323. *                text to use as a label. Works in conjunction
  3324. *                with LAMX_LastLabel.
  3325. *
  3326. *            LAMX_LastLabel (LONG) - Locale string ID of the last
  3327. *                text to use as a label. Works in conjunction
  3328. *                with LAMX_FirstLabel. When building the interface the
  3329. *                code will loop from FirstLabel..LastLabel, look
  3330. *                up the corresponding locale strings and use the
  3331. *                data to make up the label text.
  3332. *
  3333. *            LAMX_LabelTable (LONG *) - Pointer to an array of IDs
  3334. *                to use for building the radio labels. This requires
  3335. *                that a locale hook is provided with the layout handle.
  3336. *                The array is terminated by -1.
  3337. *
  3338. *            LAMX_TabKey (BOOL) - Connect this object to the tabulator
  3339. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3340. *                to cycle to the previous entry. (V9)
  3341. *
  3342. *                    NOTE: there can be only one single button per
  3343. *                        window to use this feature.
  3344. *
  3345. *                Default: FALSE
  3346. *
  3347. *            LAMX_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3348. *                which will be set to the gadget's current setting.
  3349. *                If this tag is set, you will hear no events from this
  3350. *                object any more. (V7)
  3351. *
  3352. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3353. *                        which may be generated if the layout
  3354. *                        engine runs out of memory when rebuilding
  3355. *                        the user interface.
  3356. *
  3357. *
  3358. *        PALETTE_KIND:
  3359. *
  3360. *            LAPA_SmallPalette (BOOL) - Make the palette display
  3361. *                a bit smaller than usual.
  3362. *                Default: FALSE
  3363. *
  3364. *            LAPA_Lines (LONG) - Number of lines the palette
  3365. *                display should cover.
  3366. *                Default: No preference
  3367. *
  3368. *            LAPA_UsePicker (BOOL) - This tag effectively changes the
  3369. *                gadget type. Instead of a list of colours to pick from
  3370. *                the user will see a rectangle filled in the selected
  3371. *                colour with a picker button next to it. This gadget
  3372. *                will generate IDCMP_IDCMPUPDATE events when the picker
  3373. *                button is pressed. (V10)
  3374. *
  3375. *
  3376. *        PASSWORD_KIND (string gadget type which does not
  3377. *            display its contents):
  3378. *
  3379. *            LAPW_LastGadget (BOOL) - Pressing return with this
  3380. *                gadget active will stop activating the next
  3381. *                following string gadget type if TRUE is passed.
  3382. *                Default: FALSE
  3383. *
  3384. *            LAPW_HistoryLines (LONG) - Number of lines to keep as
  3385. *                a backlog.
  3386. *                Default: 0
  3387. *
  3388. *            LAPW_HistoryHook (struct Hook *) - Hook code to call
  3389. *                when entering a line into the backlog. See gtlayout.h
  3390. *                for more information.
  3391. *                Default: NULL
  3392. *
  3393. *            LAPW_Activate (BOOL) - When the window opens, make this
  3394. *                gadget the active one. (V21)
  3395. *
  3396. *                    NOTE: There can be only one gadget of this type
  3397. *                        per window.
  3398. *
  3399. *                Default: FALSE
  3400. *
  3401. *            This object type accepts all the GTST_#? tag items.
  3402. *
  3403. *
  3404. *        POPUP_KIND:
  3405. *
  3406. *            (This features requires gtlayout.library v22 or higher
  3407. *             and Kickstart 3.0 or higher).
  3408. *
  3409. *            LAPU_FirstLabel (LONG) - Locale string ID of the first
  3410. *                text to use as a label. Works in conjunction
  3411. *                with LAPU_LastLabel.
  3412. *
  3413. *            LAPU_LastLabel (LONG) - Locale string ID of the last
  3414. *                text to use as a label. Works in conjunction
  3415. *                with LAPU_FirstLabel. When building the interface the
  3416. *                code will loop from FirstLabel..LastLabel, look
  3417. *                up the corresponding locale strings and use the
  3418. *                data to make up the label text.
  3419. *
  3420. *            LAPU_LabelTable (LONG *) - Pointer to an array of IDs
  3421. *                to use for building the cycle labels. This requires
  3422. *                that a locale hook is provided with the layout handle.
  3423. *                The array is terminated by -1.
  3424. *
  3425. *            LAPU_TabKey (BOOL) - Connect this object to the tabulator
  3426. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3427. *                to cycle to the previous entry.
  3428. *
  3429. *                    NOTE: there can be only one single button per
  3430. *                        window to use this feature.
  3431. *
  3432. *                Default: FALSE
  3433. *
  3434. *            LAPU_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3435. *                which will be set to the gadget's current setting.
  3436. *                If this tag is set, you will hear no events from this
  3437. *                object any more.
  3438. *
  3439. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3440. *                        which may be generated if the layout
  3441. *                        engine runs out of memory when rebuilding
  3442. *                        the user interface.
  3443. *
  3444. *            LAPU_CentreActive (BOOL) - If TRUE, the popup menu will
  3445. *                appear with the currently active entry centred below
  3446. *                the mouse pointer. (V31)
  3447. *
  3448. *            LAPU_Labels (STRPTR *) - Pointer to NULL-terminated array
  3449. *                of strings that are the choices offered.
  3450. *
  3451. *
  3452. *        SCROLLER_KIND:
  3453. *
  3454. *            LASC_Thin (BOOL) - Make the scroller a bit thinner
  3455. *                than usual.
  3456. *                Default: FALSE
  3457. *
  3458. *            GA_RelVerify (BOOL) - Hear every IDCMP_GADGETUP
  3459. *                event from scroller.
  3460. *                Default: TRUE
  3461. *
  3462. *                        NOTE: This is different from what
  3463. *                         gadtools.library uses.
  3464. *
  3465. *            GA_Immediate (BOOL) - Hear every IDCMP_GADGETDOWN
  3466. *                event from scroller
  3467. *                Default: TRUE
  3468. *
  3469. *                        NOTE: This is different from what
  3470. *                         gadtools.library uses.
  3471. *
  3472. *
  3473. *        SLIDER_KIND:
  3474. *
  3475. *            LASL_FullCheck: TRUE will cause the code to rattle
  3476. *                through all possible slider settings, starting
  3477. *                from the minimum value, ending at the maximum value.
  3478. *                While this may be a good idea for a display
  3479. *                function to map slider levels to text strings
  3480. *                of varying length it might be a problem when
  3481. *                it comes to display a range of numbers from
  3482. *                1 to 40,000: the code will loop through
  3483. *                40,000 iterations trying to find the longest
  3484. *                string.
  3485. *
  3486. *                FALSE will cause the code to calculate the
  3487. *                longest level string based only on the
  3488. *                minimum and the maximum value to check.
  3489. *                While this is certainly a good a idea when
  3490. *                it comes to display a range of numbers from
  3491. *                1 to 40,000 as only two values will be
  3492. *                checked the code may fail to produce
  3493. *                accurate results for sliders using display
  3494. *                functions mapping slider levels to strings.
  3495. *
  3496. *                Default: TRUE
  3497. *
  3498. *
  3499. *        STRING_KIND:
  3500. *
  3501. *            LAST_LastGadget (BOOL) - Pressing return with this
  3502. *                gadget active will stop activating the next
  3503. *                following string gadget type if TRUE is passed.
  3504. *                Default: FALSE
  3505. *
  3506. *            LAST_Link (LONG) - Gadget ID of the listview to attach
  3507. *                this string gadget to.
  3508. *
  3509. *                    NOTE: you need to add the string gadget before
  3510. *                        you add the listview to refer to it or the
  3511. *                        layout routine will get confused.
  3512. *
  3513. *            LAST_Picker (BOOL) - Attach a `select' button to the
  3514. *                right hand side of the string gadget.
  3515. *                Default: FALSE
  3516. *
  3517. *            LAST_HistoryLines (LONG) - Number of lines to keep as
  3518. *                a backlog.
  3519. *                Default: 0
  3520. *
  3521. *            LAST_HistoryHook (struct Hook *) - Hook code to call
  3522. *                when entering a line into the backlog. See gtlayout.h
  3523. *                for more information.
  3524. *                Default: NULL
  3525. *
  3526. *            LAST_Activate (BOOL) - When the window opens, make this
  3527. *                gadget the active one. (V21)
  3528. *
  3529. *                    NOTE: There can be only one gadget of this type
  3530. *                        per window.
  3531. *
  3532. *                Default: FALSE
  3533. *
  3534. *
  3535. *        TAB_KIND:
  3536. *
  3537. *            (This features requires gtlayout.library v24 or higher)
  3538. *
  3539. *            LATB_FirstLabel (LONG) - Locale string ID of the first
  3540. *                text to use as a label. Works in conjunction
  3541. *                with LATB_LastLabel.
  3542. *
  3543. *            LATB_LastLabel (LONG) - Locale string ID of the last
  3544. *                text to use as a label. Works in conjunction
  3545. *                with LATB_FirstLabel. When building the interface the
  3546. *                code will loop from FirstLabel..LastLabel, look
  3547. *                up the corresponding locale strings and use the
  3548. *                data to make up the label text.
  3549. *
  3550. *            LATB_LabelTable (LONG *) - Pointer to an array of IDs
  3551. *                to use for building the cycle labels. This requires
  3552. *                that a locale hook is provided with the layout handle.
  3553. *                The array is terminated by -1.
  3554. *
  3555. *            LATB_TabKey (BOOL) - Connect this object to the tabulator
  3556. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3557. *                to cycle to the previous entry.
  3558. *
  3559. *                    NOTE: there can be only one single button per
  3560. *                        window to use this feature.
  3561. *
  3562. *                Default: FALSE
  3563. *
  3564. *            LATB_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3565. *                which will be set to the gadget's current setting.
  3566. *                If this tag is set, you will hear no events from this
  3567. *                object any more.
  3568. *
  3569. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3570. *                        which may be generated if the layout
  3571. *                        engine runs out of memory when rebuilding
  3572. *                        the user interface.
  3573. *
  3574. *            LATB_FullSize (BOOL) - By default a TAB_KIND object
  3575. *                covers the entire width of the group it sits in.
  3576. *                With LATB_FullSize set to true it will cover the
  3577. *                width of the entire Window.
  3578. *
  3579. *                Default: FALSE
  3580. *
  3581. *            LATB_Labels (STRPTR *) - Pointer to NULL-terminated array
  3582. *                of strings that are the choices offered.
  3583. *
  3584. *
  3585. *        TAPEDECK_KIND:
  3586. *
  3587. *            LATD_ButtonType (LONG) - Select the image to display
  3588. *                in the button, must be one of the following:
  3589. *
  3590. *                    TDBT_BACKWARD
  3591. *                        "<<" Symbol
  3592. *
  3593. *                    TDBT_FORWARD
  3594. *                        ">>" Symbol
  3595. *
  3596. *                    TDBT_PREVIOUS
  3597. *                        "|<" Symbol
  3598. *
  3599. *                    TDBT_NEXT
  3600. *                        ">|" Symbol
  3601. *
  3602. *                    TDBT_STOP
  3603. *                        Stop symbol (filled square)
  3604. *
  3605. *                    TDBT_PAUSE
  3606. *                        "||" pause symbol (broken square)
  3607. *
  3608. *                    TDBT_RECORD
  3609. *                        Record symbol (filled circle)
  3610. *
  3611. *                    TDBT_REWIND
  3612. *                        "<" symbol
  3613. *
  3614. *                    TDBT_EJECT
  3615. *                        Eject symbol (broken upward pointing arrow)
  3616. *
  3617. *                    TDBT_PLAY
  3618. *                        ">" symbol
  3619. *
  3620. *            LATD_Toggle (BOOL) - Make this object a toggle-select
  3621. *                button.
  3622. *                Default: FALSE
  3623. *
  3624. *            LATD_Pressed (BOOL) - Make this button appear to be
  3625. *                pressed.
  3626. *
  3627. *                    NOTE: requires "LATD_Toggle,TRUE" attribute.
  3628. *
  3629. *                Default: FALSE
  3630. *
  3631. *            LATD_Smaller (BOOL) - Make this button a bit smaller
  3632. *                than usual.
  3633. *                Default: FALSE
  3634. *
  3635. *            LATD_Tick (BOOL) - Hear IDCMP_GADGETUP events while the
  3636. *                buttons is being pressed; the IntuiMessage->Code entry
  3637. *                will be 0 while the button is being pressed, and
  3638. *                will be 1 as soon as the button is released. (V12)
  3639. *
  3640. *                Default: FALSE
  3641. *
  3642. *
  3643. *        TEXT_KIND:
  3644. *
  3645. *            LATX_Picker (BOOL) - Attach a `select' button to the
  3646. *                right hand side of the text display.
  3647. *                Default: FALSE
  3648. *
  3649. *            LATX_LockSize (BOOL) - After doing the initial layout
  3650. *                for this object, do not adapt its size again during
  3651. *                subsequent layouts. This is particularly useful if
  3652. *                you have a TEXT_KIND object in a paged group
  3653. *                and update its contents later. You need
  3654. *                to specify an object width using LA_Chars, otherwise
  3655. *                the layout engine may make it not wide enough to
  3656. *                display any text. (V15)
  3657. *
  3658. *
  3659. *        VERTICAL_KIND (group to align objects vertically):
  3660. *        HORIZONTAL_KIND (group to align objects horizontally):
  3661. *
  3662. *            LAGR_Spread (BOOL) - Place all objects in this
  3663. *                group with roughly the same amount of space
  3664. *                between them.
  3665. *                Default: FALSE
  3666. *
  3667. *            LAGR_SameSize (BOOL) - Make all objects in this
  3668. *                group the same size (for vertical groups:
  3669. *                the same height, for horizontal groups:
  3670. *                the same width).
  3671. *                Default: FALSE
  3672. *
  3673. *            LAGR_LastAttributes (BOOL) - Try to copy the
  3674. *                size of the previous group for this new
  3675. *                group. May not work if this group turns
  3676. *                out to be larger than the previous group.
  3677. *                Default: FALSE
  3678. *
  3679. *            LAGR_ActivePage (LONG) - Organize all child
  3680. *                groups as pages which can be flipped through
  3681. *                using LT_SetAttributes(). You need to
  3682. *                specify the number of the first page to
  3683. *                display, starting from 0.
  3684. *
  3685. *                    NOTE: Specifying this tag actually enables
  3686. *                        the paging feature. If you omit this
  3687. *                        tag calls to flip to a specific
  3688. *                        page will fail.
  3689. *
  3690. *                Default: No paging
  3691. *
  3692. *            LAGR_Frame (BOOL) - Draw a recessed frame around
  3693. *                this group, even if there is no group label. (V7)
  3694. *
  3695. *            LAGR_IndentX (BOOL) - Add extra horizontal indentation
  3696. *                for this group. (V10)
  3697. *
  3698. *            LAGR_IndentY (BOOL) - Add extra vertical indentation
  3699. *                for this group. (V10)
  3700. *
  3701. *            LAGR_NoIndent (BOOL) - Inhibit automatic size adjustion
  3702. *                and centring of this group if it is smaller than
  3703. *                the neighbouring groups. (V21)
  3704. *
  3705. *            LAGR_SameWidth (WORD) - During the final layout pass,
  3706. *                make this group the same width as the group which
  3707. *                uses the given ID. Not implemented yet. (V25)
  3708. *
  3709. *            LAGR_SameHeight (WORD) - During the final layout pass,
  3710. *                make this group the same height as the group which
  3711. *                uses the given ID. Not implemented yet. (V25)
  3712. *
  3713. *            LAGR_FrameGroup (UWORD) - Surround this group with a
  3714. *                frame. Must be one of FRAMETYPE_Label or FRAMETYPE_Tab.
  3715. *                FRAMETYPE_Label works like "LAGR_Frame,TRUE," while
  3716. *                FRAMETYPE_Tab is for use with a TAB_KIND object you
  3717. *                must put directly on top of this group or the group
  3718. *                will look a little silly. (V38)
  3719. *
  3720. *                Default: FRAMETYPE_None
  3721. *
  3722. *
  3723. *        XBAR_KIND (horizontal separator bar):
  3724. *
  3725. *            LAXB_FullSize (BOOL) - Make this separator bar span
  3726. *                the entire window width.
  3727. *
  3728. *
  3729. *        YBAR_KIND (vertical separator bar):
  3730. *
  3731. *            No tags are defined for this type of object.
  3732. *
  3733. *
  3734. *   RESULT
  3735. *    none
  3736. *
  3737. *   BUGS
  3738. *    Up to v25 the SCROLLER_KIND object did not support GA_Immediate
  3739. *    or GA_RelVerify. The space for the variables was there, but the
  3740. *    code was missing.
  3741. *
  3742. *    POPUP_KIND objects don't work well in simple refresh windows,
  3743. *    as refresh events can get lost. Use a smart refresh window
  3744. *    instead or call gadtools.library/LT_CatchUpRefresh() regularly.
  3745. *
  3746. *   SEE ALSO
  3747. *    gadtools.library/CreateGadgetA
  3748. *
  3749. ******************************************************************************
  3750. *
  3751. */
  3752.  
  3753. VOID LIBENT
  3754. LT_NewA(REG(a0) LayoutHandle *handle,REG(a1) struct TagItem *tagList)
  3755. {
  3756.     if(handle != NULL)
  3757.     {
  3758.         struct TagItem *List,*Entry;
  3759.         STRPTR label;
  3760.         LONG type;
  3761.         LONG id;
  3762.  
  3763.         type    = -1;
  3764.         label    = NULL;
  3765.         id        = 0;
  3766.         List    = tagList;
  3767.  
  3768.         while((Entry = NextTagItem(&List)) != NULL)
  3769.         {
  3770.             switch(Entry->ti_Tag)
  3771.             {
  3772.                 case LA_Type:
  3773.  
  3774.                     type = Entry->ti_Data;
  3775.                     break;
  3776.  
  3777.                 case LA_ID:
  3778.  
  3779.                     id = Entry->ti_Data;
  3780.                     break;
  3781.  
  3782.                 case LA_LabelID:
  3783.  
  3784.                     if(handle->LocaleHook != NULL)
  3785.                     {
  3786.                         label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)Entry->ti_Data);
  3787.                     }
  3788.                     else
  3789.                     {
  3790.                         handle->Failed = TRUE;
  3791.  
  3792.                         return;
  3793.                     }
  3794.  
  3795.                     break;
  3796.  
  3797.                 case LA_LabelText:
  3798.  
  3799.                     label = (STRPTR)Entry->ti_Data;
  3800.                     break;
  3801.             }
  3802.         }
  3803.  
  3804.         LT_AddA(handle,type,label,id,tagList);
  3805.     }
  3806. }
  3807.  
  3808.  
  3809. /*****************************************************************************/
  3810.  
  3811.  
  3812. /****** gtlayout.library/LT_EndGroup ******************************************
  3813. *
  3814. *   NAME
  3815. *    LT_EndGroup -- end a group declaration.
  3816. *
  3817. *   SYNOPSIS
  3818. *    LT_EndGroup(Handle);
  3819. *                 A0
  3820. *
  3821. *    VOID LT_EndGroup(LayoutHandle *);
  3822. *
  3823. *   FUNCTION
  3824. *      This is just a short form of
  3825. *
  3826. *           LT_New(Handle,
  3827. *               LA_Type, END_KIND,
  3828. *           TAG_DONE);
  3829. *
  3830. *      It helps to save (some) space.
  3831. *
  3832. *   INPUTS
  3833. *        Handle - Pointer to LayoutHandle.
  3834. *
  3835. *   RESULT
  3836. *    none
  3837. *
  3838. *   SEE ALSO
  3839. *    gtlayout.library/LT_New
  3840. *
  3841. ******************************************************************************
  3842. *
  3843. */
  3844.  
  3845. VOID LIBENT
  3846. LT_EndGroup(REG(a0) LayoutHandle *handle)
  3847. {
  3848.     if(handle != NULL && NOT handle->Failed)
  3849.     {
  3850.         /* new in 45.1: fail if there is no group to be closed */
  3851.         if(handle->CurrentGroup == NULL)
  3852.         {
  3853.             handle->Failed = TRUE;
  3854.         }
  3855.         else
  3856.         {
  3857.             handle->CurrentGroup = handle->CurrentGroup->Special.Group.ParentGroup;
  3858.         }
  3859.     }
  3860. }
  3861.